I have this SQL query:
>> Truncated for clarity << CREATE TABLE [dbo].[StoreGroups]( [GroupName] [nvarchar](30) NOT NULL, [Store] [int] NOT NULL, [Client] [smallint] NOT NULL CONSTRAINT [DF_StoreGroups_Client] DEFAULT ((1)), CREATE TABLE [dbo].[Stores]( [Client] [smallint] NOT NULL CONSTRAINT [DF_Stores_Client] DEFAULT ((1)), [Store] [int] NOT NULL, CREATE TABLE [dbo].[AppUsers]( [UserID] [nvarchar](20) NOT NULL, [Password] [nvarchar](50) NOT NULL, [AuthorityLevel] [smallint] NOT NULL, [Stores] [varchar](30) NULL, [Area] [varchar](50) NULL,
Here is how I tried it:
Select * from appusers au left join storegroups sg on au.stores = sg.groupname left join stores s on (isnumeric(au.stores) = 1 and au.stores = s.store) or sg.store = s.store
but I got stuck with the second left join.
storeString = (from au in xm.AppUsers join sg in xm.StoreGroups on au.Stores equals sg.GroupName into JoinedGroups from jg in JoinedGroups.DefaultIfEmpty().....
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.