Use of Variable in sql query

Posted: August 6, 2010 in Mysql Stuff

select @a:=stuid from student_master where enrollno = ‘834’;

select * from student_trans where stuid =@a and sessid=’7′ and currentclass=’1′;

select * from bill_master where F_student_master = @a and F_sessions =’7′;

select * from receipt_main where F_student_master = @a and F_Sessions=’7′;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s