0

enter image description here

After the union the result is given above I want to remove the empty field in test_values column the query used for union is

> SELECT tt.test_name,tt.test_category,report.test_values,tt.unit FROM
> report LEFT JOIN tt ON report.test_id = tt.id UNION SELECT
> tt.test_name,tt.test_category,report.test_values,tt.unit FROM report
> RIGHT JOIN tt ON report.test_id = tt.id where test_values IS NOT NULL

1 Answers1

0

Its Silly,I have not defined NULL in query this is how i solved this it don't return the NULL value instead it return the '' string

 SELECT tt.test_name,tt.test_category,report.test_values,tt.unit FROM report LEFT JOIN tt ON report.test_id = tt.id where test_values!='' union
                        SELECT tt.test_name,tt.test_category,report.test_values,tt.unit FROM report RIGHT JOIN tt ON report.test_id = tt.id where test_values!=''