Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Query - values not equal for the same column

Status
Not open for further replies.

Shal2

Programmer
Dec 3, 2001
52
NZ
Hi all,
I have a table which has 3 columns with values like shown below:

Style Region Price

1 NZ 10
1 AUS 10
2 NZ 20
2 AUS 20
3 NZ 30
3 AUS 30
4 NZ 40
4 AUS 50

Now, is it possible to just display the last two rows using SQL query,since the Price for them is different, even though the style is same, also region is different ??? The reason is to correct the price value if there is any difference in the price for the two regions for the same styles.

Any ideas are welcome,

Thank you,
Shal
 
Try:

select style, count(region), max(price), min(price)
from youtable
group by style
having max(price) <> min(price)
 
Thank you Marsh,

It served my purpose

Regards,
Shal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top