The following are the related lines of my query that I have a problem I cannot resolve:
IF (servicesalesdetailsopen_v.complaintcode LIKE 'IVWIP', 'Y', 'N') as intflag
LEFT JOIN servicesalesdetailsopen_v
ON servicesalesopen_v.ronumber = servicesalesdetailsopen_v.ronumber and servicesalesopen_v.vehid = servicesalesdetailsopen_v.vehid and servicesalesdetailsopen_v.cora_acct_code = 'XXX-S'
The query brings back accurate results but line by line for detailed line items within the servicesalesdetailsopen table. I only want a Y set as intflag if IVWIP is on ANY row in the servicesalesopen_v.complaintcode for the repair orders and it brings back every line item with a Y or an N for each line. I would like the result in one line by RO.
How do I accomplish one line results by RO?
This is ongoing. I don't want to have to address it when it's imported into another database.