sql - Selecting the items associated with a tag along with the tags associated with these items -


2 तालिकाओं:
आइटम (item_id, ...)
टैग (टैग_id, item_id) < Br <>

मैं आइटम ("आइटम" तालिका से) का चयन कैसे कर सकता हूं, जिसमें इन वस्तुओं से संबंधित सभी टैग के साथ उनके साथ एक विशेष टैग ("टैग" तालिका में) है?

उपयोग करें:

  SELECT i। *, T.tag_id FROM ITEMS मैं टी पर टाइप कर रहा हूँ t.item_id = i.item_id जहां i.item_id IN (SELECT x.item_id से टैग x जहां x.tag_id =?)  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -