Select Top 1 * From Table Fails In Sybase Procedure
Am trying to Fetch Only one record from the Sybase Table without using the RowCount Function, even though 'WHERE Condition' returns multiple results. SELECT TOP 1 EMPLOYEE_NAME FRO
Solution 1:
Top is supported only in outer query only, here is the link
For ordered data I am using having cause instead Top 1 in Sybase, like:
SELECT EMPLOYEE_NAME FROM EMPLOYEES WHERE EMPLOYEEID >50HAVING EMPLOYEEID =MIN(EMPLOYEEID)
I hope it helps a bit. GL!
Solution 2:
I know it is late but just for others TOP inside a subquery can be used in sybase latest version.
Post a Comment for "Select Top 1 * From Table Fails In Sybase Procedure"