Thread: select

    #1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2002
    Posts
    26
    Rep Power
    0

    select


    hi,

    How can I construct a SELECT query which select only the latest version of my document??

    for eg: I have a same document with different versions... 1,2,3 etc.... I need to select the document which has the latest version ..in this case 3

    wud appreciate any help..

    TIa,
    sands
  2. #2
  3. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    538
  4. #3
  5. No Profile Picture
    Java Developer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    5
    Rep Power
    0
    Assuming you've got a variable in the table that contains the date of the doc.... (and if I remember rightly you're using oracle), so try something like this....

    select doc from doctable where (doc,date) in (select doc, max(date) from doctable where name='whateveryoucalledit.doc');

IMN logo majestic logo threadwatch logo seochat tools logo