![]() |
Need help with a query
Here it is
[sql]SELECT * FROM post WHERE userid = 1 AND postid IN SELECT reviewids from product where productid = 3 [/sql] The product table has a field called reviewids which is a list of reviewsids in this format 980,1020,2212 I know I can execute a single query to grab the ids and a second query to make this check (which should return true or false), but I'd rather do it in one query if I can. |
Nothing wrong with a subquery if you can do it :)
|
wouldn't he need to explode and FIND_IN_SET the original listed data if it's in the format of 454,5656,34232,134?
|
If he's using MySQL4 then he can use subqueries :) Personally for scalability I'd get a list of ID's, and then use WHERE productid IN($ids)
|
Ah.. Well, I'm not using 4+. I broke it in half pretty much as you described Dean. Thx.
|
All times are GMT. The time now is 11:38 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|