Welcome Guest, Not a member yet? Register   Sign In
group_by syntax
#4

[eluser]liamstask[/eluser]
I've been told now by a couple non-CI SQL people that
Code:
GROUP BY (2 * HOUR(timestamp) + FLOOR( MINUTE(timestamp) / 30 ))
is the appropriate syntax to specify half-hour bins, so I'm feeling reasonably confident that part's ok. Still having trouble getting this to work with the CI active record group_by( ) method, though, which is rendering it as
Code:
GROUP BY (`2` * HOUR(`timestamp`) + FLOOR( MINUTE(`timestamp`) / `30` ))

My working, uninformed theory is that the single quotes should be removed. Any other thoughts, or ideas on how to remove them?

Thanks!


Messages In This Thread
group_by syntax - by El Forum - 03-27-2008, 10:58 AM
group_by syntax - by El Forum - 03-27-2008, 11:18 AM
group_by syntax - by El Forum - 03-27-2008, 11:27 AM
group_by syntax - by El Forum - 03-28-2008, 09:26 AM
group_by syntax - by El Forum - 03-28-2008, 12:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB