current position:Home>MySQL group query gets the data of the first 24 hours in each group

MySQL group query gets the data of the first 24 hours in each group

2022-02-03 00:28:09 CSDN Q & A

According to the data in the following table id,itemid grouping take create_time front 24 Hours of data
id itemid create_time value
1 a 29/2/2116 84
1 a 29/2/2116 103
1 a 1/3/2116 89
1 b 1/3/2116 98
1 b 2/3/2116 96
1 b 2/3/2116 98
1 b 1/3/2116 109
2 a 1/3/2116 119
2 a 1/3/2116 129
2 a 1/3/2116 107
2 b 1/3/2116 111
2 b 2/3/2116 110
2 b 3/3/2116 98
2 b 4/3/2116 93

give the result as follows
id itemid create_time value
1 a 29/2/2116 84
1 a 29/2/2116 103
1 b 1/3/2116 98
2 a 1/3/2116 119
2 a 1/3/2116 129
2 a 1/3/2116 107
2 b 2/3/2116 110




Refer to the answer 1:

take create_time front 24 Hours of data The meaning of this sentence is not understood




Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202030028073701.html

Random recommended