I have a subquery that is meant to select only the TOP 1 matching row, however
I was getting the: "At most one record can be returned by this subquery." error
This was weird considering I was using "Top 1" keyword in the subquery -- so I
extracted the subquery - and exported the results. It returns 2 rows - IF the
value is the same. (?!!)
Here is the query:
SELECT TOP 1 Tbl1.Name
>From (((T2 INNER JOIN T3 ON T2.AID = T3.AID)
INNER JOIN T4 ON T3.T4ID = T4.T4ID)
INNER JOIN Tbl1 ON T4.PgID = Tbl1.PgID)
WHERE (T2.photoID = #GetResults.photoID#)
ORDER BY T2.T2ID
Why isn't TOP working like it's supposed to?? If the Name is the same (which is
possible) it returns it twice! I assume if I include the T2.T2ID in the results
it might return only 1 - but then that would be two columns and wouldn't work
as a subquery.. right?
The DB is Access. Not sure the year (97, 2003 etc)
Thanks,
Scottdoc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive: http://www.houseoffusion.com/groups/sql/message.cfm/messageid:3217
Subscription: http://www.houseoffusion.com/groups/sql/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.6