Column A Column B
117220177 BOOK9488
117220177 NULL
14061 NULL
Oracle query for selecting rows:
When Column B has two rows corresponding to column A then pick row with non-null value in Column B. When there is only one row then pick irrespective of value in Column B
Expected Output:
Column A Column B
117220177 BOOK9488
14061 NULL
Best Answer
fiddle