09-07-2007, 12:24 PM
|
#2 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
Isn't it @myVar:= and not $v1:=? In any case, I do like the way you do it for the sub-selects, but I also like the way variables can make things much more readable.
For instance:
Code:
SELECT
@count:=COUNT(*)
FROM
myTable
HAVING
@count > 1
Obviously this is a useless example but it's how I use the variables for on such statements as inner joins where the query can get somewhat complex.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|