Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to write a search query in the below condition
    primarykey
    data
    text
    <p>I have a table named <code>ad_categories</code> and its structure is like this <img src="https://i.stack.imgur.com/pdH1r.jpg" alt="enter image description here"></p> <p>And i have another table named <code>pub_categories</code> and its structure is like this <img src="https://i.stack.imgur.com/S4Maa.jpg" alt="enter image description here"></p> <p>id in both table are different I need to select <code>id's of ad_categories</code> WHERE any of the <code>ad_categories.cid should be in pub_categories.cid OR any of ad_categories.scid should be in ad_categories.scid OR any of the ad_categories.tcid should be in pub_categories.tcid</code> i have cid list up to 35 ,scid up to 250 and tcid up to 600. How can achieve this any one please help me..</p> <p>cid is main category scid is sub category and tcid is thrid subcategory. ad_category is where advertisers select categories and pub_catogries is publisher selecting categories. i have categories up to 30 subcatrgires up to 250 and thrid categories up to 600. both advertisers and publishers can select multiple categories i have tried by exploding pub_categories cid, scid and tcid by ',` and using like condition searching for the value like this</p> <pre><code>(ad_cat.cid LIKE '%,1,%' OR ad_cat.cid LIKE '%,1') OR (ad_cat.cid LIKE '%,2,%' OR ad_cat.cid LIKE '%,2') OR (ad_cat.scid LIKE '%,1,%' OR ad_cat.scid LIKE '%,1') OR (ad_cat.scid LIKE '%,2,%' OR ad_cat.scid LIKE '%,2') OR (ad_cat.scid LIKE '%,3,%' OR ad_cat.scid LIKE '%,3') OR (ad_cat.scid LIKE '%,4,%' OR ad_cat.scid LIKE '%,4') OR (ad_cat.scid LIKE '%,5,%' OR ad_cat.scid LIKE '%,5') OR (ad_cat.tcid LIKE '%,1,%' OR ad_cat.tcid LIKE '%,1') OR (ad_cat.tcid LIKE '%,2,%' OR ad_cat.tcid LIKE '%,2') OR (ad_cat.tcid LIKE '%,3,%' OR ad_cat.tcid LIKE '%,3') OR (ad_cat.tcid LIKE '%,4,%' OR ad_cat.tcid LIKE '%,4') OR (ad_cat.tcid LIKE '%,5,%' OR ad_cat.tcid LIKE '%,5') </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload