plsql - Replace the value -


we have column 'a' in 'x' , 'y' table. if value of column 'a' not null need consider in 'x' table otherwise need consider in 'y' table.

based on requirement how achieve it?

thanks in advance

sounds you're asking nvl function. based on limited information go on work you...

create table x(id int, varchar(255)); insert x(id, a) values(1, 'one'); insert x(id, a) values(2, null); insert x(id, a) values(3, 'three');  create table y(id int, varchar(255)); insert y(id, a) values(1, 'one'); insert y(id, a) values(2, 'two'); insert y(id, a) values(3, 'three');  select x.id, nvl(x.a,y.a) x, y x.id = y.id; 

results in...

id  ========== 1   1 2   2 3   3 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -