Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Old 01-16-2005, 09:41 PM   PM User | #1
troublesome
New to the CF scene

 
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
troublesome is an unknown quantity at this point
Unhappy Mysql Sub Select Problem Pls Help!!!



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
troublesome is offline   Reply With Quote
Old 01-17-2005, 09:02 AM   PM User | #2
raf
Master Coder


 
Join Date: Jul 2002
Posts: 6,589
Thanks: 0
Thanked 0 Times in 0 Posts
raf is on a distinguished road
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
raf is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:46 PM.

Home - Contact Us - Archives - Link to CF - Resources - Top 

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.