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

objective c - iPhone and it's wireless area -

unix - Listing all shared memory segments used by a process on AIX5.3+ -

tsql - Correct sql/hql query (aggregate in where clause) -