Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
HEY Im a NOOB and am doing this for a class. All I want to know is how can I get the CUST_CODE values to not repeat.SELECT INVOICE.CUS_CODE, CUS_BALANCEFROM INVOICE, CUSTOMERWHERE CUSTOMER.CUS_CODE=INVOICE. CUS_CODEORDER BY CUS_CODE;
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2010-04-18 : 22:33:30
you wanted this ?
SELECT INVOICE.CUS_CODE, SUM(CUS_BALANCE)FROM INVOICE, CUSTOMERWHERE CUSTOMER.CUS_CODE=INVOICE. CUS_CODEGROUP BY INVOICE.CUS_CODEORDER BY INVOICE.CUS_CODE;