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!

Simple Select statement

Status
Not open for further replies.

critical5

Programmer
Dec 13, 2006
37
GB
Hi there,

I haven't used mysql for a while and I would like to know how to declare a variable for this: I want to be able to do the following but replace CP123 in the WHERE CLAUSE by whatever I specify. Possibly declare a variable??
Thanks

select DISTINCT *from memorandums
WHERE MEMO_REFERENCE = 'CP123'
 
which application language are you using? they all have a different way of specifying variable valules

by the way, DISTINCT used with the dreaded, evil "select star" is redundant -- you should probably use neither

r937.com | rudy.ca
 
You may also like to look at:
and possibly:

___________________________________________________________
If you want 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
Steam Engine Prints
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top