I'm using mysql v 4.0.something (so no subselects :( )
I have a table of shoppingcarts, and a table of cartitems. cartitems
have the cartuid of the shoppingcart they're in. Pretty simple, right?
if I do:
SELECT * from shoppingcarts left join cartitems on cartitems.cartuid=
shoppingcarts.uid LIMIT 50,10;
The LIMIT clause will be limiting the number of "rows" I get back in
the results (of course). What I *want* it to limit is the number of
"shoppingcarts" I get back. So I can make a tool that shows 10
shopping carts (with items in them) per page.
If I could do subselects, this is what the query would look like:
select * from shoppingcarts left join cartitems on cartitems.cartuid=
shoppingcarts.uid where shoppingcarts.uid in (select uid from
shoppingcarts order by created desc LIMIT 50,10);
(obviously that's untested since I can't do subselects on my mysql).
How can I do that with a left join instead? thanks