dcsimg
Results 1 to 3 of 3

Thread: Get the first row of query (Sybase)

  1. #1
    Join Date
    Oct 2003
    Posts
    8

    Get the first row of query (Sybase)

    Dear All,
    What is the SQL syntax to get the first row of a query in Sybase ASE? Something likes in SQL Server 2000 :

    SELECT TOP 1 Name
    FROM User


    Thanks.
    Last edited by geossl; 08-15-2004 at 08:13 AM.

  2. #2
    Join Date
    Sep 2004
    Location
    VA
    Posts
    2
    SET ROWCOUNT 1
    SELECT Name FROM dbo.User

    Hope this helps

  3. #3
    Join Date
    Sep 2004
    Location
    VA
    Posts
    2
    sorry forgot to add...Rowcount will be set at the SESSION level so to remove execute a 'SET ROWCOUNT 0' statement.

Posting Permissions

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