Home > database >  Great god give directions, SQL server query problem
Great god give directions, SQL server query problem

Time:03-30

From the query in the form of personnel entering and leaving out nearly 3 days in and out of more than 10 times a day the personnel information, please tell a great god,
Table columns: MJJCJLXXBZ access to record information identification, xm's name, id GMSFZHM, MJDBH access point number, sk_rqsj time

CodePudding user response:

 
The SELECT arjun JJCJLXXBZ a.x m, al-qeada MSFZHM, arjun JDBH, a.s k_rqsj FROM record name a JOIN (
The SELECT GMSFZHM, CONVERT (VARCHAR (8), sk_rqsj, 112) sk_rqsj FROM record name WHERE DATEDIFF (dd, sk_rqsj, GETDATE ()) & lt;=3 GROUP BY GMSFZHM, CONVERT (VARCHAR (8), sk_rqsj, 112) HAVING a COUNT (1) & gt; 10
B) ON al-qeada MSFZHM=b.g MSFZHM AND CONVERT (VARCHAR (8), a.s k_rqsj, 112)=b.s k_rqsj

Is probably so, nearly three days don't know what do you want to calculate to greatly the day before yesterday, if you don't put & lt;=3 to & lt; 3
  • Related