I have a table (Table 1) that has a composite primary key (Column1 + Column2). I use it as a foreign key in another table (Table 2).
Now I want the SELECT statement to select all the records from Table 1 and Table2. But it returns me 0 rows, because table2 is empty. I want all the entries from table 1, and if it does not exist in table2, the value of the columns in table2 should be zero.
I know, I only need to join him. But I do not understand.
thanks
sql sql-server tsql sql-server-2005
Scorpion
source share