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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -