Home > database >  SQL beg god to reassure
SQL beg god to reassure

Time:05-20


To find out the same time interval training organization unit of data ah
Used for supporting unit of the same class in the same period showed no twice or more,
Strives for the code

CodePudding user response:

SELECT training organization unit, the start time and end time
The FROM training plan for the record information
GROUP BY training organization unit, the start time and end time
HAVING the COUNT (*) & gt; 1

CodePudding user response:

Ran out of a great god, and this is not repeat the information of time,,

CodePudding user response:

refer to the second floor Super busy, superman's response:
great god, and not repeat time ran out of the information,,



Didn't figure in the two data calculated?

You get some test data

CodePudding user response:

SELECT training organization unit
The FROM training plan for the record information
WHERE the start time & gt;=you set the time range of start time
AND end time & lt;=you set the time range of end time
GROUP BY training organization unit
HAVING the COUNT (*) & gt; 1
  • Related