Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL variables

Status
Not open for further replies.

riluve

Technical User
Mar 11, 2005
78
US
I want to declare some variable and use it a few times in a query e.g.

x = 30

SELECT count(*)
FROM table
WHERE field > x
 
MySQL documentation is quite good for this sort of question:

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
LOL - thank you very much, but actually I dont find it as useful as one might think. It is especially lacking in actual examples and mis leading information (e.g. appearently LN(x) doesn't work and neither does LOG(x1,x2) - ONLY log(x1) really works!). So yeah after a day with finding errors in it I am not to happy looking at it.

AND after spending almost and hour tying to figure out and being misled by DEFINE - I couldn't find the proper alternative (thank you for showing me SET!). I agree, if I knew the answer it would have been easy to find, but I didn't know the answer which is why i broke down and asked!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top