mysql - Querying two tables for rows that exist between a date period -


i'm querying 2 tables , returning dates exists between time period.

(              select date_format(date, '%y-%m-%d') date             `users exercises`             `userid` = $user->id , (date >= '$begin' , date <= '$end')             group day(date)             order date              ) union (              select date_format(date, '%y-%m-%d') date             `users foods`             `userid` = $user->id , (date >= '$begin' , date <= '$end')             group day(date)             order date  ) 

i'm using union sense maybe there better method achieve i'm wanting?

both tables have same structure:

id | userid | date (timestamp) 


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -