خرید بک لینک

Vote count: 0

I have have a MYSQL query to join 3 tables together. There is an events table and for each event there are a number of dates.

I am trying to create a query so that it pulls out each event and only the start date for that event.

Now with the query below it fetches the results but I have a repeat of the event row for each date in the event_dates table.

SELECT *
FROM events
LEFT JOIN event_dates ON events.event_id = event_dates.event_id
LEFT JOIN user ON user.user_id = events.owner_id
GROUP BY events.event_id
ORDER BY event_dates.event_start_timestamp ASC

The event_dates table contains the row event_start_timestamp

I've tried to group by using the following GROUP BY events.event_id, event_start_timestamp DESC but it does not work

I would like to adapt the above so that the join is performed but it only selects each event once and shows only the starting date for that event.

Any help would be appreciated. Thanks

asked 39 secs ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 7 مرداد 1395 ساعت: 22:18

صفحه بندی