Home > database >  SQL processing problem.
SQL processing problem.

Time:10-03


O solve ~


CodePudding user response:

 select b.d, count (1) 
The from test1 a, (select distinct c, d from test2) b
Where a.=biggest
And a. d. in 20160101201010 (2)
Group by b.d.

CodePudding user response:

 
Select count (*), xuehao (b), xingming (d), a. anji (a)
The from test1. A, b test2
Where a. anji=b.b anji
And a.x uehao=b.x uehao
And a.x uehao between 1100 and 1200
The group by xuehao, (b), xingming (d), a. anji (a)

CodePudding user response:

The select b.d, count (1)
The from test1 a, (select c, d from test2) b
Where a.=biggest
And a. d. in (' 20160101 ', '20160102')
Group by b.d.

CodePudding user response:

refer to the second floor jdsnhan response:
 
Select count (*), xuehao (b), xingming (d), a. anji (a)
The from test1. A, b test2
Where a. anji=b.b anji
And a.x uehao=b.x uehao
And a.x uehao between 1100 and 1200
The group by xuehao, (b), xingming (d), a. anji (a)

Table name write in parentheses, use the version?
Feel a little weird

CodePudding user response:

If the time is a date type, you can change my date type
 select t2. Name (d), count (*) from test1 t1, test2 t2 where t1. The class (a)=t2. The class (a) and t1) time (d) between '20160101' and '20160102' group by t2. The name (d) 

CodePudding user response:

T2 second records of student number should be in 1101?
The select t2. B class, t2. D. name, count (*) as number of subjects from test2 t2 left join test1 t1 on t2. C=t1.
Where a t1. D. in (20160101201010);
  • Related