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

authentication - Mongodb revoke acccess to connect test database -

python - GitPython: check if git is available -

c# - ASP.NET MVC Enumerable to delimited HTML in Razor -