sql - Select and assign to variable in one statement? -


i'd display results of query, , i'd capture column's value @ same time. from , where same in both queries. can both in 1 query, or easier/better query twice, this?

declare @fooid int  set @fooid = (select fooid bar snuhid = 5)  select * bar snuhid = 5 

unfortunately has done in 2 operations.

test:

declare @var datetime select @var=getdate(), getdate() 

yields error message 141.

here's post on this.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -