If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
subquery doesn't work in mysql (was "SQL Statement Help needed")
I am having issue with query which works in MS SQL But does not work in MySQL..Can someone help me how can I do same or similar with MY SQL..
My MS SQL Statement is as follows
select * from products where categoryid in (select distinct categoryid from tblcart,products where products.sku = tblcart.productid and cartID='767867867868')
the only thing that could possible be wrong is that you aren't on the current release, 4.1, which has been in production status since october, and which supports subqueries
the only thing that could possible be wrong is that you aren't on the current release, 4.1, which has been in production status since october, and which supports subqueries
I have ticket open with my hosting company on version as you mentioned. Let say they do not have 4.1 installed then what should I do..I have to write two queries to do this task ?...
select p2.*
from tblcart
inner
join products as p1
on tblcart.productid
= p1.sku
inner
join products as p2
on p1.categoryid
= p2.categoryid
where cartID = '767867867868'
select p2.*
from tblcart
inner
join products as p1
on tblcart.productid
= p1.sku
inner
join products as p2
on p1.categoryid
= p2.categoryid
where cartID = '767867867868'
Thank you for your help...I will try and let you know