MySQL Forums
Forum List  »  Newbie

Re: Using two tables with DATEDIFF
Posted by: Peter Brawley
Date: May 15, 2016 07:53PM

From table1, not table1 from.

Don't quote the Selects, put them in parens.

Or write ...

select datediff(a.date_finish,b.date_start)
from table1 a
join table2 b using(id)
where a.id='xxx';

Options: ReplyQuote


Subject
Written By
Posted
Re: Using two tables with DATEDIFF
May 15, 2016 07:53PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.