I have a View called upcoming_birthday
which returns a list of people having birthday on the next 7 days (special thanks: Upcoming Birthday based on Current Date and Upcoming Birthdays for this week).
I have a Procedure that takes as input the ID of a company and outputs every customer linked to said company. By link
I mean "has a relation with". The origin of those links are sign up by
or purchased at
(ie customers can be signed up by a company A and, after purchasing something at company B, they'll have a link with companies A and B).
Now I'd like to join those two results. Something like:
SELECT a.* FROM upcoming_birthday AS b INNER JOIN (CALL proc_account_link_company(2)) AS a ON b.id = a.id
Is it doable?