MySQL Forums
Forum List  »  Newbie

Re: Operand should contain 1 column(s) - how to get extra info from subquery?
Posted by: Peter Brawley
Date: February 05, 2019 05:04PM

Is this what you mean?

select p.person_last, p.person_first, ifnull(t.persontag_enddate,'Unknown') as 'expiry date'
from persons p
left join persons_tags t using(person_id)
where t.persontag_enddate is null or t.persontag_enddate > now()-interval 3 year
order by person_last, person_first;

Options: ReplyQuote




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.