So I’d like it to be something like, or have the effect of:
declare vFN varchar(20);
declare vLN varchar(20);
set vFN, vLN = (select fname, lname from sometable where id = 1);
Obviously, I could do 2 selects, but that seems very inefficient.
tia
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you should try
check http://dev.mysql.com/doc/refman/5.0/en/select-into.html for documentation.