I have been trying to use application code to loop a tesult set with absolutely no luck whatsoever. I would like to know if it is possible using some fancy artsy fartsy sql to get this working.
The code below gives me my entire result set which is fine however I need one row for location_name, addr1, and city. All of the other attributes will have 1 and many rows associated with the location_name, city, etc.
location AS t1
Join email AS t2 ON t1.location_id = t2.location_id AND t1.customer_id = t2.customer_id
Join report AS t3 ON t1.customer_id = t3.customer_id AND t1.location_id = t3.location_id
WHERE t3.stamp >= date_sub(now(), interval 1 day) AND t1.customer_id = '1' AND t2.location_id = '66'
My desired first row output would look like:
location_name addr1 city
somecustomer 1234.. Los Angeles
And the next row:
name email w_name r_type i_type disposition report
tom a@d.. Jim W gold band A 1
jane w@f.. Pete silver band A 0