Quantcast
Channel: Latest Questions by aRookieBIdev
Viewing all articles
Browse latest Browse all 76

SQL SELECT QUERY HELP

$
0
0
Hi All, I have a table as below TableA (Code,Description,effectivedate) ![alt text][1] We have identified a list of possible duplicates , in the above case there are 2 Codes with the same description .However I need to take only "ALB". The code that shall be picked is marked with (B) in the identified code list and these identified codes could be hard coded in the query and it is not available in any table. The next rule is quite simple ; when there are duplicate codes with different description chose the latest code based on effective date. ![alt text][2] I need to get the data from the table based on 2 rules. Please suggest me some ideas. Thanks in advance. NK [1]: /storage/temp/1544-1.png [2]: /storage/temp/1545-2.png

Viewing all articles
Browse latest Browse all 76

Trending Articles