![]() |
|
|
|||||||
![]() |
|
|
Thread Tools | Rate Thread |
|
|
PM User | #1 |
|
New to the CF scene Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
right this problem has been getting on my nerves for a while, its my final year project and cant seem to get round the problem. As ive now found out that mysql server does not support sub selects. If it did id code it like this : $QueryUnSold = "Select Item_Table.Item_Id, Item_Table.Seller_ID, Item_Table.Sale, Item_Table.Category, Item_Table.Sub_Category, Item_Table.Advert_Title, Item_Table.Price, Item_Table.Sale_Start, Item_Table.Sale_Dur, Item_Table.Sale_End from Item_Table WHERE Item_Table.Item_ID != (SELECT Item_Table.Item_ID FROM Item_Table, Transaction_Table WHERE Item_Table.Item_ID = Transaction_Table.Item_Id and Item_Table.Seller_ID = 010581919)"; Subselect getting all id's which are in transaction_table with a particular seller which are also in item_id. i then want to get the oppossite of these id's... that is why i need the sub select but i get the error even when putting it in mysqlfront which is You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT Item_Table.Item_ID FROM Item_Table, Transaction_Table WH |
|
|
|
|
|
PM User | #2 |
|
Master Coder ![]() ![]() Join Date: Jul 2002
Posts: 6,589
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
mysql supports subselects from version 4.1. so if you realy need them, then use the current stable version.
else, you need to use an outre join for your find-unmatched query, but this can only be done if Transaction_Table.Item_Id is a Not Null field ...
__________________
Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Rate This Thread | |
|
|