How do I select only 1 line in sybase without using the number of entries


How do I select only 1 row in sybase without using rowcount? I don't have the privilege to set rowcount in sybase. Is there a way to select only 1 row?

For example:

select * from table where name = 'jack'

This returns two rows; how do I select only one row from the result set without using set rowcount?

Try the query:

SELECT TOP 1 * FROM mytable
WHERE name = 'jack'

As you might guess, this selects the TOP 1 matching results. If you wanted more (which you don't here) you could use any number (TOP 100 or TOP 1000, etc).

A more comprehensive example can be found on w3schools: