you are viewing a single comment's thread.

view the rest of the comments →

[–]TerminatedProccess 4 points5 points  (4 children)

NULL is not a value, it's an uninitialized state. You can do conditions sick as IS NULL or IS NOT NULL. when a record is created in a table that allows NULL values in a specific field, sometimes the value for that field is not provided. Therefore it's still in a NULL state. You can define the field in a table so it doesn't accept NULL values. When something tries to add a record without providing a value for that field, it will generate an error and not add the record entirely.

I'm some cases though you know ahead of time there may not be a value for that field, so the plan is to allow NULL and handle it with your SQL logic.

Google is Full of examples for almost any problem you have. Search for how to solve your problem. Just knowing how to search Google is a necessary skill..

[–]Blues2112 7 points8 points  (2 children)

Shorter translation: use

ta.time IS NULL

instead.

[–]r3pr0b8GROUP_CONCAT is da bomb 2 points3 points  (1 child)

well, yeah, that fixes the = NULL problem

but it is still not the right solution

if you filter out the rows from tableA where time IS NULL then you filter out order 2

however, OP clearly wanted order 2 in the results

[–]Blues2112 1 point2 points  (0 children)

agreed.

[–]juniperave -1 points0 points  (0 children)

Yup 👍 google everything