Experts -
I have a table with 3 attributes -- ID, NBR and CODE.
values in the table will be
ID NBR CODE
43247 46064 Red
52395 52268 Green
52760 52268 Green
49025 52852 Green
49025 52852 Red
49025 52852 Yellow
51681 72523 Green
45202 131179 Yellow
13127 440587 Yellow
13128 440587 Green
Can I have a query where the output is chosen depending on the code for the unique combination of ID and NBR
the order of CODE is Red, Yellow and Green
ex: for NBR of 52852 I have all 3 CODE's i.e. Red, Yellow and Green. the output should be of the record Red only
Similarly for 440587 I have 2 CODE's i.e. Yellow and Green. the output should be of the record Yellow only
If there are multiple Red's, Yellow's or Green's only one record can be shown (not all is needed in the output)
Thanks for your help
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.