I want to create an insert but I want to check if the last insert of a table is null. When its null I dont want to insert it.
I have a table named users_ill.
id | user_id | health_at | created_at
Here is my insert statement:
INSERT INTO users_ill (user_id) VALUES ($1);', [user_id]);
But now I want to check also if the health_at is null or not. How can I check this with insert ?
I can also write another query but I think this would be not necessarry when its work with insert and select together.