Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group by exact match on string
Message
 
 
To
28/07/2011 10:20:14
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01519453
Message ID:
01519456
Views:
22
Can you please translate in English what do you want to achieve? Better provide input and desired output.

>I want to find all rows representing records that have at least one exact match on a varchar(100) column
>
>I am current doing
>
>
>SELECT 
>        name
>       ,symbol
>      ,from_date
>      ,thru_date
>  FROM [iSource100].[dbo].[Symbology]
>  where exists ( select Name, COUNT(symbol) as cntsym from Symbology
>  where thru_date > GETDATE()
>  group by Name having COUNT(symbol) > 1 ) 
>  and thru_date > GETDATE()
>order by name
>
>
>but from the results I'm getting it appears a 'match' for grouping seems to be based on just the first three characters of the Name column.
>
>How can I tell it to group by the entire contents of Name being an exact match?
>
>TIA
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform