Possible Duplicate:
need help with some stored procedure plz
ERROR:-
A SELECT statement that assigns a value to a variable must not be combined with data-retrieval operations.
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.
The error you are getting is that your select is updating a variable while spitting out the results at the same time.
Split up your queries as follows: