Results 1 to 5 of 5

Thread: SQL statment

  1. #1
    Join Date
    Jul 2003
    Location
    porto - Portugal
    Posts
    74

    Unanswered: SQL statment

    Hi,

    Somebody could tell me how i can select the first row of a table when
    ocurr for example state='W'.
    I just want the first row for this ocurrence..
    thanks a lot!

    Rui

  2. #2
    Join Date
    Jun 2002
    Location
    UK
    Posts
    525
    select *
    from table
    where state = 'W'
    fetch first 1 rows only;

  3. #3
    Join Date
    Jul 2003
    Location
    porto - Portugal
    Posts
    74
    Thanks damian!

    Originally posted by Damian Ibbotson
    select *
    from table
    where state = 'W'
    fetch first 1 rows only;

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: SQL statment

    select * from tab1 where state='W' fetch first 1 row only

    The result may be differenct each time you issue this statement ....

    If you want a consistent row, then you may need to do an order by

    Cheers
    Sathyaram

    Originally posted by rmleite
    Hi,

    Somebody could tell me how i can select the first row of a table when
    ocurr for example state='W'.
    I just want the first row for this ocurrence..
    thanks a lot!

    Rui
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  5. #5
    Join Date
    Jul 2003
    Location
    porto - Portugal
    Posts
    74
    Thanks Sathya!

Posting Permissions

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