I'm trying to write a query to extract the rows "not expired"
I have a database with a table in which are there :
IdActivity lifespan (months)
And another table in which I have:
IdSubject IdActivity StartDate
Now I want to extract all IdSubject with not expired yet activity
I need something like (I know it's wrong: it's only to make clear what I want):
SELECT IdSubject FROM Tab2 INNER JOIN Tab1 USING(IdActivity)
WHERE DATEADD(StartDate, INTERVAL lifespan MONTS)>NOW()
I made many attempts but nothing worked!
Thanks in advance for your time.