[SQL Server 2008 issues] Not able to select match and non match by left join |
Not able to select match and non match by left join Posted: 31 Aug 2013 06:48 PM PDT I would like to check category by lob that exists or not on the basis of @Match Parameter.I can do this by Exists logic by using if and else statement for @Match parameter but like to do with join @Match=0 Means all non match values@Match=1 Means all match valuesProblem : Getting same result for both @Match=0 or @Match=1 and lobid=4 :doze:declare @table table (categoryid int)declare @t table(categoryid int,lobid int)insert @tselect 1,2 union all select 2,3insert @tableselect 1 union all select 2declare @match bit=0select a.categoryid,b.lobid from @table a left join @t bon a.categoryid=b.categoryidand (b.lobid=4 and @match=1) or (b.lobid is null and @match=0)Please Suggest |
How to get how many memory is used for each T-SQL ? Posted: 31 Aug 2013 02:40 AM PDT Dear All, Please kindly help below, Many thanks!1. how do you know that how many memory is used for each T-SQL ?2. how do you know the memory is used by each database for the SQL Server instance? |
You are subscribed to email updates from SQLServerCentral / SQL Server 2008 - General / SQL Server 2008 To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
No comments:
Post a Comment