Sybase SQL Anywhere 怎么取数据第一行
Sybase SQL Anywhere 怎么取数据库第一行
SQL Server 语法
select top 1 from oper_log;
Oracle 语法
select * from oper_log where rownum = 1;
Sybase SQL Anywhere 用什么语法呢
我用top 1 提示出错
[解决办法]
SELECT * FROM (
SELECT *,ROW_NUMBER() OVER(ORDER BY DM) DM1 FROM AA ) AA WHERE DM1=1
OR
SELECT TOP 1 * FROM AA ORDER BY DM
[解决办法]
ASA12测试OK:
SELECT TOP 5 * FROM product ORDER BY productid DESC
[解决办法]
很明显是ASA5不支持top
[解决办法]
sigh, 数据库太古老了,只能凭借理解性的SQL来试了,
试试这个,看看好不好用?
select * from oper_log a where not exists (select 1 from oper_log where a.oper_date+a.oper_time< oper_date + oper_time)