Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Group by including nulls

mk270dMar 14 2017 — edited Mar 14 2017

Hi All,

my oracle version is 11.2.0.2

Sample data

Table Name -  t_applicant

sz_customer_noi_applicant_idsz_tranzware_cust_no
32631NULL
32632NULL
32643NULL
32654NULL
32665NULL
32676NULL
32677NULL
NULL8NULL
NULL9NULL

From the above table i need query which fetches records with  unique customer id and the result should contain all the null values.

Here is a query which i created which fetches only one null value of the sz_customer_id column not all the null values of the sz_customer_id column.

select min(apt.i_applicant_id) i_applicant_id, apt.sz_customer_no

      from wf_t_notifications t, t_applicant apt

     where apt.sz_tranzwar_customer_no is  null

       group by apt.sz_customer_no;

My requirement is to fetch all the null values of sz_customer_no column with unique sz_customer_no(all null values should be present in result).

This post has been answered by Frank Kulash on Mar 14 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 11 2017
Added on Mar 14 2017
4 comments
686 views