MySQL Forums
Forum List  »  Newbie

Re: subselect fails
Posted by: Brian Case
Date: June 19, 2018 02:20PM

Thank you for your prompt response.

at least one, perhaps many workunits for a project.
a workunit may have no associated billing records, or it may have many.
project ([key] projectid, ...)
workunit ([key] workunitid, [fk] projectid ...)
billing ([key] billingid, [fk] workunitid ...)

Assume p.projectid = 9
w.workunitid = 1 has workunit.projectid = 9; (assume field 'phase', value "Initial Deposit")
w.workunitid = 2 has w.projectid = 9 ("Masonry")
b.billingid = 1 has b.workunitid = 1 ('Amount' "7969")
b.billingid = 2 has b.workunitid = 1 ("2362.5")

The preferred SQL would return
"Initial Deposit" "7969"
"Initial Deposit" "2362.5"
"Masonry" NULL

Options: ReplyQuote


Subject
Written By
Posted
June 19, 2018 10:27AM
June 19, 2018 12:01PM
Re: subselect fails
June 19, 2018 02:20PM
June 19, 2018 02:45PM
June 22, 2018 12:31PM
June 22, 2018 03:09PM
June 22, 2018 03:19PM
June 19, 2018 02:30PM


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.