Click here to Skip to main content
16,018,353 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have the following query..now i have to check if the same columns have same data..
Can anyone help me with the query pls


SQL
SELECT FirstName,MiddleName,LastName,Company,TaxExempt,AddressTitle,AddressLine1,AddressLine2,City,[State],ZipCode,Country,PhoneNumber,EmailID,o.OrderNumber,o.PONumber FROM CustomerAddresses ca join Orders o on ca.CustomerID=o.CustomerID  where AddressTitle='Billing'
Posted
Updated 18-Feb-14 21:29pm
v3

SQL
SELECT FirstName,MiddleName,LastName,Company,TaxExempt,AddressTitle,AddressLine1,AddressLine2,City,[State],ZipCode,Country,PhoneNumber,EmailID,
o.OrderNumber,o.PONumber FROM CustomerAddresses ca join Orders o on ca.CustomerID=o.CustomerID ,Count(*)As Count where AddressTitle='Billing'
Group by FirstName,MiddleName,LastName,Company,TaxExempt,AddressTitle,AddressLine1,AddressLine2,City,[State],ZipCode,Country,PhoneNumber,EmailID,
o.OrderNumber,o.PONumber FROM CustomerAddresses ca join Orders o on ca.CustomerID=o.CustomerID Having Count(*)>1
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900