I'm a newbie to SQL Server. Please help me to write the following Logic in a query.
If getnow() > today 4 PM
Then
SELECT *
FROM table
WHERE MailDate is Tomorrow
Else
SELECT *
FROM table
WHERE MailDate is Today
I'm a newbie to SQL Server. Please help me to write the following Logic in a query.
If getnow() > today 4 PM
Then
SELECT *
FROM table
WHERE MailDate is Tomorrow
Else
SELECT *
FROM table
WHERE MailDate is Today
It does not have to be in a stored procedure.
select a.name, if(a.is_active='t','Active','Inactive') from mytable a