Archives of the TeradataForum
Message Posted: Thu, 13 Jun 2002 @ 06:10:13 GMT
Subj: | | How to specify how many rows are to be returned by the SELECT statement |
|
From: | | Serge Hauswirth |
In order to have only the first row returned by the SELECT, I tried the following statement :
SELECT JahrWoche , Lagerbestand
FROM NGT_Lagerbestand
WHERE ArtikelNr = '10011000' AND JahrWoche < 200217 AND Lagerbestand IS NOT NULL
ORDER BY JahrWoche DESC SAMPLE 1
But SAMPLE does not take any account of the ORDER BY Clause.
Is there a way to get the first row in a SELECT statement?
|