Need to create a view. I have a payhistory file and need to pull the invoices and corresponding custnums from it. Problem is the the payhistory files has multiple transactions on each invoice# so I'm getting back much replication of invoice#s, and custnum, correct data but I want and need only 1 of each not the replication to use the view to my advantage...
SELECT TOP 100 PERCENT Invoice, customer
FROM dbo.payhistory
WHERE (Invoice IS NOT NULL AND Invoice <> 1)
ORDER BY Invoice
11144 134
11144 134
11144 134
11122 90
11122 90
11122 90
11122 90
to
11144 134
11122 90
TIA!
SELECT TOP 100 PERCENT Invoice, customer
FROM dbo.payhistory
WHERE (Invoice IS NOT NULL AND Invoice <> 1)
ORDER BY Invoice
11144 134
11144 134
11144 134
11122 90
11122 90
11122 90
11122 90
to
11144 134
11122 90
TIA!