Convert two date columns from two different tables into one in sql server -


i need make query in sql server.. have 2 tables

table#1:

id -- onedate -- hourswork 1 -- 25/04/2014 -- 5 2 -- 26/04/2014 -- 7 

table#2:

id -- adate -- hoursrest 1 -- 25/04/2014 -- 5 

i want query result

id -- date -- hourswork -- hoursrest 1 -- 25/04/2014 -- 5 -- 5 2 -- 26/04/2014 -- 7 -- 0 

as can see need match id , date.

select table1.id , table1.onedate , table1.hourswork , isnull(table2.hoursrest, 0) table1 left join table2 on table1.id = table2.id 

Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -