ravi sharma

ravi sharma

  • NA
  • 87
  • 16.8k

Distinct in sql with case sensetive text

Jan 11 2017 4:14 AM
Hi,
 
 
I need to get result with distinct on tag  field by considering case sensetive for following query.
 
SELECT
Distinct [SC].[Tag] AS Tag

FROM [dbo].[ScenarioTags] AS [sc]

INNER JOIN [dbo].[Scenarios] AS [scn] ON [sc].[ScenarioId] = [scn].[ScenarioId]

LEFT OUTER JOIN [dbo].[Scenarios_Contacts] AS [soc] ON [sc].[ScenarioId] = [soc].[ScenarioId]

INNER JOIN [dbo].[Tools] AS [tl] ON [scn].[ToolId] = [tl].[ToolId]

INNER JOIN [dbo].[Services_Tools] AS [st] ON [tl].[ToolId] = [st].[ToolId]

INNER JOIN [dbo].[Services] AS [s] ON [st].[ServiceId] = [s].[ServiceId]

WHERE [sc].[CreatedById] = '003V000000GIdvgIAD' OR [soc].[ProfileId] = '003V000000GIdvgIAD' AND [scn].[IsDeleted] = 'false' AND [scn].[IsScenarioSaved]='true' AND

[tl].[IsActive] = 'true' AND [s].[Code] IN (N'TA3-DCS', N'TA3-MOS', N'TA3-ABM', N'TA3-EGS', N'TA3-CSS', N'TA3-SOSN', N'TA3-PMGMT', N'TA3-CMKTG')
 
I tried to distinct but it is showing single result for both QA Im and qa IM
 
Please suggest.

Answers (1)