The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled SQL Code
Posted by: Aslan | August 31, 2009 @ 7:41pm
Revision 1 - Original post on August 31, 2009 @ 7:31pm
SQL Code
[
Download
]
mysql> explain select day, sum(impressions) as ti from daily_app_user_impressions, app_user_mappings where daily_app_user_impressions.source_app_user_id = app_user_mappings.id and app_user_mappings.app_id = 2 group by day order by day desc; +----+-------------+----------------------------+------+-----------------------------------------------------------------+-------------------------------+---------+------------------------------------------------------------------------------+------+---------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------------------------+------+-----------------------------------------------------------------+-------------------------------+---------+------------------------------------------------------------------------------+------+---------------------------------+ | 1 | SIMPLE | daily_app_user_impressions | ALL | index_daily_app_user_impressions_on_source_app_user_id | NULL | NULL | NULL | 1 | Using temporary; Using filesort | | 1 | SIMPLE | app_user_mappings | ref | index_app_user_mappings_on_id,index_app_user_mappings_on_app_id | index_app_user_mappings_on_id | 5 | archetypereporting_development.daily_app_user_impressions.source_app_user_id | 1 | Using where | +----+-------------+----------------------------+------+-----------------------------------------------------------------+-------------------------------+---------+------------------------------------------------------------------------------+------+---------------------------------+ 2 rows in set (0.00 sec)
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.47 / 8
51 Votes