Sybase SQL Anywhere 怎么取数据库第一行

时间:2021-07-24 13:35:39
Sybase SQL Anywhere 怎么取数据库第一行

SQL Server 是用 TOP 1
Oracle 是用 rownum = 1


Sybase SQL Anywhere 用什么呢


高手请教。。。。

9 个解决方案

#1


一样的用top 1啊

#2


Sybase SQL Anywhere 怎么取数据库第一行


我用Powere Builder的ODBC连接的,出错

#3


该回复于2011-01-17 09:21:08被版主删除

#4


引用 2 楼 yo_yo2005 的回复:
我用Powere Builder的ODBC连接的,出错

你帖出你的sql语句看看.

比如表test

select top 1 * from test 即可。
不是select top [1] ....

#5


的确是 TOP 1

#6


可能和你的asa版本有问题吧。 
我这边是9.0.2是可以的。 

#7



(DBA)> select property('productversion')
property('productversion')                                                                                                                                                                                                                                       
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
9.0.2.3044                                                                                                                                                                                                                                                       

(1 rows)

Execution time: 0.004 seconds

(DBA)> select top 1 * from employee_bak
emp_id      manager_id  emp_fname            emp_lname            dept_id     street                                   city                 state            zip_code   phone      status ss_number   salary                 start_date termination_date birth_date bene_health_ins bene_life_ins bene_day_care sex 
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
102         501         Fran                 Whitney              100         9 East Washington Street                 Cornwall             NY               02192      6175553985 A      017349033   45700.000              1984-08-28 (NULL)           1958-06-05 Y               Y             N             F   

(1 rows)

Execution time: 0.03 seconds
[Sybase][ODBC Driver][SQL Anywhere]The result returned is non-deterministic.
The result returned is non-deterministic.
SQLCODE=122, ODBC 3 State="01000"
Line 1, column 1
select top 1 * from employee_bak
Press ENTER to continue...

#8


楼主:
当你的问题得到解决时,请及时结帖。
谢谢。 

#9


结贴了吗?mmmm长度不够呢。

#1


一样的用top 1啊

#2


Sybase SQL Anywhere 怎么取数据库第一行


我用Powere Builder的ODBC连接的,出错

#3


该回复于2011-01-17 09:21:08被版主删除

#4


引用 2 楼 yo_yo2005 的回复:
我用Powere Builder的ODBC连接的,出错

你帖出你的sql语句看看.

比如表test

select top 1 * from test 即可。
不是select top [1] ....

#5


的确是 TOP 1

#6


可能和你的asa版本有问题吧。 
我这边是9.0.2是可以的。 

#7



(DBA)> select property('productversion')
property('productversion')                                                                                                                                                                                                                                       
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
9.0.2.3044                                                                                                                                                                                                                                                       

(1 rows)

Execution time: 0.004 seconds

(DBA)> select top 1 * from employee_bak
emp_id      manager_id  emp_fname            emp_lname            dept_id     street                                   city                 state            zip_code   phone      status ss_number   salary                 start_date termination_date birth_date bene_health_ins bene_life_ins bene_day_care sex 
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
102         501         Fran                 Whitney              100         9 East Washington Street                 Cornwall             NY               02192      6175553985 A      017349033   45700.000              1984-08-28 (NULL)           1958-06-05 Y               Y             N             F   

(1 rows)

Execution time: 0.03 seconds
[Sybase][ODBC Driver][SQL Anywhere]The result returned is non-deterministic.
The result returned is non-deterministic.
SQLCODE=122, ODBC 3 State="01000"
Line 1, column 1
select top 1 * from employee_bak
Press ENTER to continue...

#8


楼主:
当你的问题得到解决时,请及时结帖。
谢谢。 

#9


结贴了吗?mmmm长度不够呢。