Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create table article
- (
- id int
- constraint article_pk
- primary key,
- subject text,
- body text
- );
- create table tag
- (
- id int
- constraint tag_pk
- primary key,
- name text
- );
- create table article_tag
- (
- tag_id int,
- article_id int
- );
- SELECT a.subject, t.name
- FROM article a
- LEFT JOIN article_tag at ON a.id = at.article_id
- LEFT JOIN tag t ON t.id = at.tag_id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement