Microsoft
Software
Hardware
Network
Question : SQL Case
I have the following query, but i need to change it a little so that i have a case statement inserted.
SELECT
TblCustomer.TelNo1,
COUNT( TblCustomer.TelNo1) AS countDups
FROM
WHERE
(TblCustomerLog.CurrentCus
tomer = 1)
GROUP BY TelNo1
HAVING COUNT(TblCustomer.TelNo1)>
1
) AS a ON a.TelNo1 = TblCustomer.TelNo1
-- TblCustomer.TelNo1
-- (CASE
-- WHEN COUNT (TblCustomer.TelNo1) > 1
-- THEN 'Duplicate'
-- ELSE 'Unique'
-- END) AS countDups,
Answer : SQL Case
your code so far is a bit reduced, so it's not obvious to see where the subquery/join is happening
this must be removed, to get those with COUNT() = 1
HAVING COUNT(TblCustomer.TelNo1)> 1
Random Solutions
Add Mirror Greyed Out
Can't access Exchange 2003 OWA from Internet
Windows XP problems after a hard drive clone of a bad drive
Websense - Block Internet Access - Except for Updates
Gracefully shutting down VMs before ESX hosts shutdown in vSphere
WS2008 Terminal Service on DC
Installing public SSL for Exchange 2007 server
What is the Best Digital Camera, that is tiny, takes video and takes great pictures?
Autocorrelation: Durbin-Watson tests
what is sugar crm