on 02-07-2023 3:33 PM
I have this querry
SELECT DISTINCT CURRENT_DATE AS "Current_Date" FROM ORDR
That i will put in a date type field.
But i want only this querry to trigger when she's empty. How do i do that?
joseih
You can use an IF statement in your SQL query to check if the date field is empty. If it is empty, then the query will execute, otherwise it won't.
Example:
IF NOT EXISTS (SELECT CURRENT_DATE FROM ORDR WHERE date_field IS NULL)
SELECT DISTINCT CURRENT_DATE AS "Current_Date" FROM ORDR;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
11 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.