Hey.. I'm a developer, but my SQL is weak... Can someone please give me a hint as to how I would do the following?
Suppose the following table:
Table: AAA
What I am trying to do is retrieve all columns in which Column2 and Column3 are distinct but have the highest possible value in column1. Assume Column1 is a key and is unique.
In this case, my query needs to return:
2 100 C
3 100 B
6 101 C
Thanks!
Suppose the following table:
Table: AAA
Code:
Column1 Column2 Column3
------- ------- -------
1 100 B
2 100 C
3 100 B
4 101 C
5 101 C
6 101 C
What I am trying to do is retrieve all columns in which Column2 and Column3 are distinct but have the highest possible value in column1. Assume Column1 is a key and is unique.
In this case, my query needs to return:
2 100 C
3 100 B
6 101 C
Thanks!