Home Group by similar values
Reply: 0

Group by similar values

user756 Published in June 20, 2018, 7:17 am

SQL server 2012.

I am capturing the UserAgent into my database and I am trying to run some queries on it on it.

I want to lump 32 bit and 64 bit entries together Below is what these show up like in the db.

Mozilla/5.0 (Windows NT 6.1; rv:26.0) Gecko/20100101 Firefox/26.0

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0

my current query:

Select     count(*) as counts, UA
from        mytable
group by    UA
order by    counts desc

What would be a good way to do this? Can I do a sub-string on the last X chars? The query I have assumes these are different entries (which is what I would expect to happen)

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.415732 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO