Skip to content
Advertisement

Best way to ignore null values in MYSQL

My data looks like this,

enter image description here

I have multiple values in the Table field with each having its own unique values for the Data field. However, Data values for TableA will be the same format in the table myTable. Same applies to all records in the Table field.

I am using JSON_EXTRACT to get the value in conjunction with CASE statements.

The problem with this is that I will be getting null values.

I am getting the below results,

enter image description here

I am expecting the below results,

enter image description here

I want to avoid the null values. Is there any other way to extract the data ? I am using MYSQL.

Advertisement

Answer

Option one:

Option two:

Here is the demo

Please note that I have changed the names of the table and columns in my demo.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement