Sql query:

Can anybody please suggest me how to assign the output of sql query to a variable in x++?

revert back ASAP. Urgent!

Thanks in advance!