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 |
|
satheesh
Posting Yak Master
152 Posts |
Posted - 2011-03-31 : 04:50:10
|
| Hi All,I want to reterview data in a table, where emailaddress is entered more than one.ie.select cstid,firstname,emailaddress from Customergroup by EmailAddress having COUNT (emailaddress) > = 2 I got this error:-Column customer.cstid' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.How to change the query.I need to select some fields where emailaddress entered more than onceRegards,SG |
|
|
ishchopra
Starting Member
24 Posts |
Posted - 2011-03-31 : 05:08:17
|
| Try thatselect cstid,firstname,emailaddress from Customergroup by EmailAddress,cstid,firstnamehaving COUNT (emailaddress) > = 2 |
 |
|
|
lionofdezert
Aged Yak Warrior
885 Posts |
|
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2011-03-31 : 06:05:20
|
| add cstid,firstname in the group by clause... |
 |
|
|
|
|
|
|
|