mysql - SQL Statement with Join - missing record ... (simple noob request) -


this noob-question, know. have 2 tables:

db design

the data looks ...

products_services:

enter image description here

product_service_categories:

enter image description here

my sql-statement looks this:

select product_service_id, product_service_name, product_service_category_name products_services join product_service_categories on products_services.product_service_category_id = product_service_categories.product_service_category_id products_services.company_id = '7' order product_service_category_name, product_service_name 

the result looks this:

sql result

i missing entry "id 2 - ernährungsberatung". entry missing because "product_service_category_id" "0".

please me correct sql-statement record too.

thank you!

replace join left join
join returns matching rows.
left join returns rows left table possible matches right table.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -