I work since this week on this request but I can't find any solution to solve my problem.
SELECT
client, summary, description, reporter, assignee,
CASE lsttf.type_f
WHEN 'O' THEN prmij.date_and_time
WHEN 'H' THEN DATE_ADD(now(), INTERVAL 7 DAY)
END as dateExecution
FROM PRM_import_Jira prmij
INNER JOIN LST_frequence lstf on prmij.fk_frequences = lstf.id
INNER JOIN LST_type_frequence lsttf ON lstf.fk_type_frequence = lsttf.id
HAVING lsttf.type_f = 'O' and dateExecution = DATE_ADD(now(),INTERVAL 7 DAY)
OR lsttf.type_f = 'H' and lstf.dayValue like concat('%',(weekday(now()+1)),'%');
I check some informations on the Web but I can"t find what I want because I have "specifics conditions" for this :
- When I execute my request, I want only this 5 columns however, "I can't" specify
lsttf.type_f
andlstf.dayValue
on my SELECT condition to useHAVING
. - I would like to use my Alias
dateExecution
but I can't with theWHERE
rules (explain here).
Thanks for your help.