October 3, 2011 at 3:12 am
Hi All,
Iam having a query which gives the desired output as shown below :
DECLARE @counter INT=0
SELECT @counter = @counter |CONVERT(INT, RoleID) from UsersRoles where UserID = 23
select @counter as Result
Please let me know the query to show the same result without using parameter.
Thanks,
Ram
October 3, 2011 at 4:09 am
SELECT MyResult = 0 |CONVERT(INT, RoleID) FROM UsersRoles WHERE UserID = 23
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
October 3, 2011 at 4:17 am
Hi Chris,
The query which u gave returns me two rows.Now i want to do Union for these row values. Could you let me know how to do aggregation.
Thanks,
Ram
October 3, 2011 at 4:34 am
It would be easier for everyone involved if you kept to one thread per subject.
http://www.sqlservercentral.com/Forums/Topic1184288-391-1.aspx
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply