Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I have this mysql setup:
- *words* table
- +----+-----------+
- | id | word |
- +----+-----------+
- | 1 | curse1 |
- | 2 | curse2 |
- | 3 | niceWord1 |
- *Category* table
- +----+-----------+
- | id | name |
- +----+-----------+
- | 1 | niceWords |
- | 2 | badWords |
- *link* table
- +----+--------+-------+
- | id | wordID | catID |
- +----+-----------+----+
- | 1 | 1 | 2 |
- | 2 | 2 | 2 |
- | 3 | 3 | 1 |
- I want to make a MySQL SELECT where I say I want to select all bad words using the link table
- So i'll get something like this output:
- +----------+------------+---------------+
- | words.id | words.word | Category.name |
- +----------+------------+---------------+
- | 1 | curse1 | badWords |
- | 2 | curse2 | badWords |
- I think I need to use JOIN of some kind, im not so good at SQL.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement