The art of sub-selects
View Single Post
09-07-2007, 12:24 PM
La Vida es Sueño
Join Date: Sep 2007
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.
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.
View Public Profile
Send a private message to Wildhoney
Visit Wildhoney's homepage!
Find More Posts by Wildhoney