Subquery / derived table / embedded
Log from IRC server Freenode (IPv6) channel #SQL.
<me> how is a embedded command called like select ID from category where type=(select type where ...)
<me> I'd like to know the proper way to do it thus find a tutorial about it
<Xgc> me: Subquery
<me> Xgc: ty
<Xgc> me: Also look into "derived table" another form of subquery. It's sometimes preferrable.
<me> Xgc: can you give me a rule of thumb about how to choose or it'll be explained ?
<Xgc> me: There's no easy rule of thumb. But I'd suggest you use a derived table where both forms seem equally applicable.
<me> Xgc: great :)<
<me> Xgc: I had a look at your suggestions. I suppose the reason I should use derived table is performance ?
<Xgc> me: That's one reason. The form is sometimes more clear as well.
<me> Xgc: cool :)
