Re: Queries and Common Practices

From: Date: Sun, 22 May 2011 14:38:49 +0000
Subject: Re: Queries and Common Practices
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-313073@lists.php.net to get a copy of this message
At 10:50 AM +0100 5/22/11, Ashley Sheridan wrote:
-snip- but I also give the table a moniker which lets me shorten the queries as I type: SELECT p.id, p.name FROM people p WHERE p.gender = 'male' This way, I can easily join in other tables, my typing is kept to a minimum as I do it also.
Ash: Whenever I see p.id (or similar) I think there is a join coming. So, I always use: SELECT id, name FROM people WHERE gender = 'male' Unless there a join, such as: SELECT p.id, p.name, a.total FROM people p, accounts.a WHERE gender = 'male' Cheers, tedd -- ------- http://sperling.com/

« previous php.general (#313073) next »