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 |
winstonsmith6076
Starting Member
4 Posts |
Posted - 2014-07-01 : 14:29:54
|
TeamI am looking to generate a query that presents all of the unique prices paid for that same part number. Each row has the part number (PARTNUM), quantity (QTY), invoice date (INVDATE), and the price paid (PRICE). As the prices change over the year, the price paid might or might not be different for that same part number. I would like to generate a query with PARTNUM, PRICE that shows only the unique prices for that part number. How would I code that? Thanks in advance. WinstonWinston Smith 6076 |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2014-07-01 : 14:31:51
|
[code]SELECT DISTINCT PARTNUM, PRICE FROM YourTable;[/code] |
 |
|
bitsmed
Aged Yak Warrior
545 Posts |
Posted - 2014-07-01 : 14:46:48
|
Wow James - You replied in 1 min and 57 sec Thats so cool. |
 |
|
winstonsmith6076
Starting Member
4 Posts |
Posted - 2014-07-01 : 16:30:32
|
Will that give me every price for the PARTNUM or only the unique prices for that PARTNUM?Winston Smith 6076 |
 |
|
winstonsmith6076
Starting Member
4 Posts |
Posted - 2014-07-01 : 17:05:51
|
It worked! Thanks.Winston Smith 6076 |
 |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2014-07-02 : 11:34:50
|
quote: Originally posted by bitsmed Wow James - You replied in 1 min and 57 sec Thats so cool.
I was waiting in the shadows and pounced on it ;) |
 |
|
|
|
|