SQL Language (MOSC)

MOSC Banner

retrieving records if no match found

edited May 27, 2020 5:09AM in SQL Language (MOSC) 4 commentsAnswered

Hi,

I have a requirement to select records , when there is a match and when there is no match. Here is a sample table and data for clarification .

create table test_rec( id number, param1 char(5), param2 char(5), param3 char(10),  param4 char(5));

insert into test_rec values( 1, 'cs','dg','usa','north');

insert into test_rec values( 2, 'cs','dg','brazil','south');

insert into test_rec values( 3, 'cs','dg','brazil',null);

insert into test_rec values( 4, 'cs','dg','argentina','west');

insert into test_rec values( 5, 'cs','dg',null,'west');

Requirement is to retrieve the records when

1. If the value for a column ( any of the 4 param columns) is passed, then whichever row matches that criteria , it should be displayed .

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center