[NF] SQL ALL, but not quite

2023-06-22 Thread Garrett Fitzgerald
Is there an idiomatic way to get parent records that have all of the child records a, b, c, and d, short of joining the child table 4 times? Oracle 19, if it's relevant. --- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html --- __

RE: [NF] SQL ALL, but not quite

2023-06-22 Thread Paul H. Tarver
Have you considered using UNION? Still four queries, but at least not four joins. Paul H. Tarver Tarver Program Consultants, Inc. -Original Message- From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Garrett Fitzgerald Sent: Thursday, June 22, 2023 6:23 AM To: profoxt..

Re: [NF] Queries re: Python & Such...

2023-06-22 Thread Garrett Fitzgerald
Is 3 days good enough? :) https://www.youtube.com/watch?v=4SP9iCnZ4NI On Thu, Feb 16, 2023 at 2:37 PM Eric Selje wrote: > That sounds really interesting. If you can post a pic of something that > takes 5 days to 3D print I'd love to see it. > --- StripMime Report -- processed MIME parts --- mu

Re: [NF] SQL ALL, but not quite

2023-06-22 Thread António Tavares Lopes
Garrett, Something like this? http://sqlfiddle.com/#!4/5ba4f0/2 On Thu, Jun 22, 2023 at 12:23 PM Garrett Fitzgerald wrote: > Is there an idiomatic way to get parent records that have all of the child > records a, b, c, and d, short of joining the child table 4 times? Oracle > 19, if it's rele

Re: [NF] SQL ALL, but not quite

2023-06-22 Thread Ted Roche
What's the relationship between parents and children (Isn't that the universal question?) If parents can have many children and children can have many parents, is there a M:M table to link them? If a child record has a single ParentFK, that's kinda sad. If you want Parents that have *ALL FOUR* o

Re: [NF] SQL ALL, but not quite

2023-06-22 Thread Garrett Fitzgerald
Yeah, that was the q&d way I ended up implementing it - with 7 child tables. :) I just couldn't believe nobody had added an idiomatic way to do it in the language without jumping through hoops to get them. It's an immunization record - I wanted all the students that had shots for Measles 1, Measles

Re: [NF] SQL ALL, but not quite

2023-06-22 Thread Ted Roche
As usual, the devil's in the details. With more details, there might have been more elegant solutions. Oracle has options like Cross-tabulation and Pivot that might give you the results you want, especially if this turns out to be an ongoing request with new vaccines coming around. On Thu, Jun 22,

Re: [NF] SQL ALL, but not quite

2023-06-22 Thread Garrett Fitzgerald
Most probably not. We were looking for test students for a new integration. While our student records system has dev, test, and prod, the immunization tracker is live, so we can only mess with it Very Carefully. :) I'll read up on those other two options just in case, though. I know what they look