Re: [GENERAL] [Q] Table aliasing

2013-10-04 Thread Ladislav Lenart
On 4.10.2013 15:11, David Johnston wrote: > Ladislav Lenart wrote >> * Should I alias one of the references to deal? >> * The above query works the same both with and without an alias, so is it >> simply >> a matter of taste / good practice? >> * Where can I find more info about this, i.e. when the

Re: [GENERAL] [Q] Table aliasing

2013-10-04 Thread David Johnston
Ladislav Lenart wrote > * Should I alias one of the references to deal? > * The above query works the same both with and without an alias, so is it > simply > a matter of taste / good practice? > * Where can I find more info about this, i.e. when the alias is mandatory > and > when it is only a con

Re: [GENERAL] [Q] Table aliasing

2013-10-04 Thread Adam Jelinek
I almost always alias my tables by default with something short (Usually 1 - 3 characters), but not my subselects for an in list. In this case I would do d1, d2, ps, and p for the different tables. I then do my best to use the same alias in all my queries. I am also big on formatting the SQL h

[GENERAL] [Q] Table aliasing

2013-10-04 Thread Ladislav Lenart
Hello. I have a noob question about table aliases in SQL. Suppose the following query: SELECT * FROM deal WHERE deal.id IN ( SELECT DISTINCT deal.id FROM deal JOIN partner_share ON deal.id = partner_share.deal_id JOIN partner ONshare.partne