This is a discussion on Problmes with count from records of 00:00 to 12:00 within the MySQL Database forums, part of the Database Forums category; $sql = "select DATE_FORMAT(date,'%d.%m.%Y') as datum, count( id )AS anzahl, id from statistik GROUP BY datum ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
$sql = "select DATE_FORMAT(date,'%d.%m.%Y') as datum,
count( id )AS anzahl, id from statistik GROUP BY datum LIMIT 60"; Now i become 60 records. But i want separate records of 00:00-12:00 and 12:01- 23:59 pre day. I think i make that's with count. But how? Sabine |
|
|||
|
== Quote from Sabine Weggner (sab12121xx@gmx.de)'s article
> $sql = "select DATE_FORMAT(date,'%d.%m.%Y') as datum, > count( id )AS anzahl, > id > from > statistik > GROUP BY > datum > LIMIT 60"; > Now i become 60 records. > But i want separate records of 00:00-12:00 and 12:01- 23:59 pre day. > I think i make that's with count. > But how? > Sabine i guess you can add a where clause to this query to only retrieve records of 00-12 and then write another one with a predicate for 12-24. is that what you are asking? -- POST BY: lark with PHP News Reader |