|
-
July 31st, 2001, 12:05 PM
#1
SQL - Get the first record only
Hi,
I need to get the first record found in a table. What I mean is the following: table ProdKeyword has ProdID and KeyWordCode fields. A product may have more than one keyword, so for example ProdID 5 may be given the keyword "x" and "y".
So, on the table ProdKeyword, there would be two records for ProdID 5:
ProdID KeywordCode
-------- ---------
5 x
5 y
When I query the table ProdKeyword for ProdID such as:
SELECT KeyWordCode
FROM ProdKeyword
WHERE ProdID = 5
... the two records return, what I want is that it returns ONLY the first record it finds where ProdID = 5
How can you do this in SQL?
Many Thanks,
RF
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|