Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Core
Starting Member
15 Posts |
Posted - 2007-07-17 : 13:53:25
|
| Hi All, before all, AMAZING FORUM!!! OLD Reader.. :)I start with a quick (i think) doubt, imagine this simple QUERY :SELECT Mov_Custos.*, Tbl_Tipo_Artigo.tipo_artigo, Tbl_Funcionario.nome_func, Tbl_Tx_Iva.taxaFROM Mov_Custos INNER JOIN Tbl_Tipo_Artigo ON Mov_Custos.id_tipo_artigo = Tbl_Tipo_Artigo.id_tipo_artigo INNER JOIN Tbl_Funcionario ON Mov_Custos.id_func = Tbl_Funcionario.id_func INNER JOIN Tbl_Tx_Iva ON Mov_Custos.id_iva = Tbl_Tx_Iva.id_ivaBut if Mov_Custos.id_func is null or '' the hole row don't appear because the WHERE part in bold.What can i do to ignore the bold part, or something else that help..I cainda need a urgent help :(THANKS FOR ANY HELP,Hugo Core |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-07-17 : 13:54:22
|
| use a left join._______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
|
Core
Starting Member
15 Posts |
Posted - 2007-07-17 : 14:03:24
|
| OMG! Thats was fast :P So many Thanks.. Reference:"The LEFT JOIN returns all the rows from the first table (Employees), even if there are no matches in the second table (Orders). If there are rows in Employees that do not have matches in Orders, those rows also will be listed." |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|