Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
以下の構造に基づいて、タグが少なくとも1回使用されているかどうかを確認するにはどうすればよいですか。
半結合は、このタスクで考えられるいくつかのクエリスタイルのEXISTS中でおそらく最速です。
EXISTS
SELECT t.* FROM taggit_tag t WHERE EXISTS ( SELECT 1 FROM taggit_taggeditem ti WHERE ti.tag_id = t.tag_id );