MySQL Forums
Forum List  »  Newbie

Sub query IN statement
Posted by: Lee Marshall
Date: April 22, 2005 01:07PM

Very confused why the following is not working:

SELECT A_ID, concat_ws(' ', concat_ws(' ', a.A_Brand, a.A_Model), a.A_Name) as product
FROM vm_accessory a WHERE a.A_ID in (
SELECT AccessoryID FROM vm_access_inter
GROUP BY AccessoryID)
ORDER BY 2

but this does

SELECT A_ID, concat_ws(' ', concat_ws(' ', a.A_Brand, a.A_Model), a.A_Name) as product
FROM vm_accessory a WHERE a.A_ID in (
6, 9)
ORDER BY 2

If I run just the subquery by itself I get 6 and 9 and no error.

Very odd.

THanks for any tips in advance.

Options: ReplyQuote


Subject
Written By
Posted
Sub query IN statement
April 22, 2005 01:07PM
April 22, 2005 02:14PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.