sql server - SQL: SELECT Statement to Return All Records, JOIN Value Is NULL, Query Returns No Records -


i have sql statement executing return data, statement joins several other tables, records returned, can display name of field, rather id.

here part of sql:

select      hardwareasset.hardwareassettitle,     hardwareasset.hardwareassetassettag,     department.departmenttitle hardwareassetdepartmenttitle,     costcentre.departmenttitle hardwareassetcostcentretitle,      hardwareasset inner join      department department on (department.departmentid = hardwareasset.hardwareassetdepartmentid) inner join      department costcentre on (costcentre.departmentid = hardwareasset.hardwareassetcostcentreid) 

my issue that, though query executes successfully, because columns (i.e ones mentioned above) have value of null, query seems return no records, though there records within table.

i have tried executing when records have columns filled in , records show. ideas?

when use inner join join field, departmentid, must have valid record in both tables. if want return records main table regardless if in join tables have use left join.

change inner join left join.


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -