sql server - How can I join 2 table with 2 join condition? -


does know how can join 2 table 2 join condition?

exmaple:

table 1 date        name      2010-01-01  ken       2010-01-01  alvin     2010-01-03  alvin     2010-01-04  ken       2010-01-07  amy      table 2 date        name     count 2010-01-01  ken      5 2010-01-01  alvin    4 2010-01-04  ken      1 2010-01-03  alvin    0 

how can join table 1 , table 2 when: table1 date = table2 date , table1 name = table2 name

select      t1.*, t2.*      t1 join t2 on t1.date = t2.date , t1.name = t2.name 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -