left join query keep a column empty

You can use GROUP BY keyword for grouping them, your query will become something like this SELECT pm.receiptID , pm.recievedAmount , pd.invono , pd.paidAmount FROM PaymentMaster pm LEFT JOIN PaymentDetail pd ON pd.receiptID = pm.receiptID GROUP BY pd.receiptID

Why do I get an error from this sub query script?

This is what your actual query is SELECT effectiveDate, CASE WHEN note=”REGULAR LOGGED” THEN log END FROM schedules LEFT JOIN timesheet ON schedules.effectiveDate = timesheet.date WHERE schedules.empid=’40’ AND YEAR(effectiveDate) = YEAR(CURDATE()) AND MONTH(effectiveDate) =’1′ GROUP BY effectiveDate. Not sure why you’re using a subquery

SQL Query To Create View [closed]

CREATE VIEW EmpList AS SELECT a.id_user, b.category_province_content, c.category_city_content, d.category_job_content FROM user_detail a INNER JOIN category_province b ON a.detail_province = b.id_category_province INNER JOIN category_city c ON a.detail_city = c.id_category_city INNER JOIN category_job d ON a.detail_job = d.id_category_job To further gain more knowledge about joins and MySQL views, kindly visit the links below: Visual Representation of SQL … Read more