Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2004-07-28 : 15:03:11
|
| Gurus,This query will return WEBSITE, WebSite How can I group these together?Instead of returning this..2 WEBSITE4 WebsiteIt would show this6 WEBSITESELECT COUNT(Ord_No) AS OrderTotal, User_Def_Fld_5FROM OEHDRHST_SQLWHERE Ord_dt >= 20040701AND Ord_Type = 'O'GROUP BY User_Def_Fld_5 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-07-28 : 15:22:14
|
My Server (ok, well one of them) is setup with the standard out of the box config, so it already does that...but try:USE NorthwindGOCREATE TABLE myTable99(Col1 varchar(10))GOINSERT INTO myTable99(Col1)SELECT 'WEBSITE' UNION ALLSELECT 'WEBSITE' UNION ALLSELECT 'WEBSITE' UNION ALLSELECT 'WEBSITE' UNION ALLSELECT 'website' UNION ALLSELECT 'website'GOSELECT UPPER(Col1), COUNT(*) FROM myTable99 GROUP BY UPPER(Col1)GODROP TABLE myTable99GO Brett8-) |
 |
|
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2004-07-28 : 15:47:02
|
| Perfect! Works. Thanks Guru! |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-07-29 : 09:04:02
|
quote: Originally posted by jrockfl Perfect! Works. Thanks Guru!
Understand that this will cause a scan of your table....Guru? Well maybe a margarita guru....oh wait, that's something else...Brett8-) |
 |
|
|
|
|
|