I have a table customer as described below.
customer_id number
customer_name varchar(30)
city varchar(20)
columns. When the below query run in Oracle db
SELECT customer_id, city FROM customer WHERE city IN ('abc', 'def', 'ghi')
I'm getting the output as shown below. Table doesn't have record for ghi
customer_id, city
1, abc
2, def
I'm trying to form the output something as below.
customer_id, city
1, abc
2, def
null, ghi
Though no record for ghi in table, want to display it in SELECT query output with rest of the column value as null.
Much appreciate help in writing sql for this scenario.
customer IN ('abc', 'def', 'ghi')works likecustomer = 'abc' OR customer = 'def' OR customer = 'ghi'INcondition needs to be in aWHEREclause, but there is noWHEREclause in your query.