Link to home
Start Free TrialLog in
Avatar of thedeal56
thedeal56

asked on

MySQL Correlated Subquery Best Practices

I've been getting around this type of issue with script instead of handling it with the initial query, and I was wondering how best to approach it from a SQL perspective.
Using this table as an example,
User generated imageHow would I design a query to select any ticket names that are like ('Replace PCs%' and IS_PARENT='1') as well as any ticket that has the PARENT_ID of the previously selected tickets? So, basically, how do I return an array containing both parent and children tickets related to a specific ticket name pattern? I would need the array to hold all fields related to the selected records. Thanks for reading.
ASKER CERTIFIED SOLUTION
Avatar of PortletPaul
PortletPaul
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of thedeal56
thedeal56

ASKER

Thank you so much.  That helps a lot.  Sorry for the static image.
no problem, it wasn't too much typing, keep it in mind next time
(using an embedded image is better than an attached image as we don't have to flip between pages)

thanks.