Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想SELECT TOP 1 ...在 db2 / dashDB 中执行等效的查询:
SELECT TOP 1 ...
SELECT TOP 1 * FROM customers
我怎样才能做到这一点?
您可以使用以下语句实现此查询FETCH FIRST x ROWS ONLY,例如
FETCH FIRST x ROWS ONLY
SELECT * FROM customers FETCH FIRST 1 ROWS ONLY
dashDB 上的另一种方法,我认为更容易的是使用“limit n”,例如
SELECT * FROM customers LIMIT 1