no, that only checks the first domain, so for example if i have:
products_id | domain
5 | 0
5 | 3
it would take 0 for if(domain=3,3,domain)
i've tried this and it almost works, but it doesn't work as it should (it only displays the first one that has domain 0, then no...
no, obviously, or i wouldn't need this :) i use php to query, and you should imagine a variable instead of 3.. it's simple: select one for each product_id but choose the one (row) that has domain 3 if possible, else choose the one with 0.
I need this:
product_id | domain_id
1 | 0
1 | 3
2 | 0
2 | 3
3 | 0
I want to select all product_ids that have the domain_id 3 (this is "my domain id", can be X, but it is not necessarily the highest) domain_id here, but...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.