Hi what is wrong in this line.
mysql_query("CREATE TABLE shipments2 TYPE=HEAP SELECT ID_number, count(On_time) FROM Shipments WHERE On_time = 1 GROUP BY ID_number"
Im trying to count how many On_time rows is there with the number 1 in it. According to ID_number. Im using PHP/MySQL/Apache.
I have for example this kind of Shipments -table:
ID_number On_time
12345 1
12345 1
12345 0
12345 1
22222 0
22222 1
22222 1
And I want new table to be like this:
ID_number On_time
12345 3
22222 2
Thanks in advance!!!
mysql_query("CREATE TABLE shipments2 TYPE=HEAP SELECT ID_number, count(On_time) FROM Shipments WHERE On_time = 1 GROUP BY ID_number"
Im trying to count how many On_time rows is there with the number 1 in it. According to ID_number. Im using PHP/MySQL/Apache.
I have for example this kind of Shipments -table:
ID_number On_time
12345 1
12345 1
12345 0
12345 1
22222 0
22222 1
22222 1
And I want new table to be like this:
ID_number On_time
12345 3
22222 2
Thanks in advance!!!