Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2004
    Posts
    5

    Unanswered: First Occurence of the record

    Can any one let me know as how can I query the first occurence of a record. I need to select all distinct Order Types from a table. If there is more than one record with the same Order Type, then I need to get the first record.

    It would be a great help to me.

    Thanks,
    John

  2. #2
    Join Date
    Feb 2002
    Posts
    2,232
    How do you determine which one is the first record ?

  3. #3
    Join Date
    Jan 2004
    Posts
    5
    I mean any randon first record. I used min (rowid) but it did not work.

    Please help me out.

    John

  4. #4
    Join Date
    Dec 2003
    Posts
    454

    did you try...

    Did you try to use Top 1 * with Order By RowID (a primary key)

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    john, what's the primary key of this table?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •