
March 28th, 2006, 04:15 AM
|
|
Registered User
|
|
Join Date: Mar 2006
Posts: 1
Time spent in forums: 2 m 8 sec
Reputation Power: 0
|
|
|
Getting too many entries, MS access
Hi.
I use this MS-ACCESS SQL query:
Quote: | SELECT * FROM (SELECT TOP 1 * FROM (SELECT TOP 3 * FROM piReport ORDER BY pi_datePi DESC) DERIVEDTBL ORDER BY pi_datePi ASC) DERIVEDTBL2 ORDER BY pi_datePi DESC |
The reason I'am using the TOP, in this why, is jsut because I want to have equalent to MySQL LIMIT function..
This query works fine, untill I have two entries with the same pi_datePi, then it is selecting them both. If I change the order by field to something different, where the two entries have different values, it works, but then again, it's pointless
How can I have this query to select just one entry, regarded that many rows can have the same value,.???
Thanks 
|