SQL Joining and Replacing spaces with NA -


i trying join 2 sql queries

for example

  • table1 have empname ,empcode
  • table2 have empname,empcode,empsalary

i trying name , salaries details wherever there no salary have reflect "na"

my query is:

select a.empname,if((empsalary=" "),"na",b.salary) salary (select empname,empcode table 1) inner join (select empcode,empsalary table 2) b on a.empcode=b.empcode 

is query correct.

select    a.empname,   case      when b.empsalary = '' or b.empsalary null 'na'      else b.empsalary    end salary table 1 inner join table 2 b on a.empcode = b.empcode 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -