Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. mrbrdo

    select field with 0 if there is no 3

    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...
  2. mrbrdo

    select field with 0 if there is no 3

    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.
  3. mrbrdo

    select field with 0 if there is no 3

    as i said: (this is "my domain id", can be X, but it is not necessarily the highest)
  4. mrbrdo

    select field with 0 if there is no 3

    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...

Part and Inventory Search

Back
Top