select from two tables...
Posted: Thu Jul 15, 2004 12:35 am
I can't remember how to do this.
I hope that explains it.
I think it's something to do with joining tables and checking for null but can't remember the code exactly.
Code: Select all
parents table
-------------------------------------------
parent_id name
1 dodge
2 ford
3 mitsubishi
childs table
-------------------------------------------
child_id name parent_id
1 spirit 1
2 stealth 1
3 focus 2
// I would like to get this result with one query
dodge: 2 models
ford: 1 model
mitsubishi: 0 modelsI think it's something to do with joining tables and checking for null but can't remember the code exactly.