“tl_items" will have 0 to Many “tl_items_classes" using the “item_id” as the KEY field.
I am compiling a SELECT query to search the dates of the classes (tl_items_classes rows), but I need to these two things:
1) Only show the EARLIEST “cl_date" in my returned list (i.e... if a class has dates for Jan 2,3,4,5,6 2016, only show Jan 2’s row)
2) In that displayed EARLIEST Class Date row, have a column that displays the complete list of related class dates in ASC order delineated by a COMMA (Group_Concat()???).
Here is a query I have started off with which show all the dates fine. Just want to fine tune it.
SELECT ic.*, i.*, DATE_FORMAT(ic.cl_date, "%M %Y") AS mo_label FROM tl_items_classes ic LEFT JOIN tl_items i ON ic.item_id = i.item_id WHERE i.active = 1 AND ic.cl_cancelled IS NULL ORDER BY ic.cl_date ASC;
Any help would be appreciated.
Don Wieland donw@pointmade.net http://www.pointmade.net https://www.facebook.com/pointmade.band
Feb 10
Pavel Zimahorau RE: Select Earliest Related Row
Feb 10, 2016; 10:55
Pavel Zimahorau
RE: Select Earliest Related Row
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!