Home > database >  Specification implementation LEFT JOIN query field sorting and according to the right table
Specification implementation LEFT JOIN query field sorting and according to the right table

Time:09-21

Existing table
T_student:
Id, name, class_id
T_class:
Id, name
Question:
How to use the Specification to achieve the following query:
The SELECT Anderson d, a.n ame, a.c lass_id FROM t_student a JOIN t_class b ON a.c lass_id=b.i d ORDER BY b.n ame.
The SELECT Anderson d, a.n ame, a.c lass_id FROM t_student a JOIN t_class b ON a.c lass_id=b.i d ORDER BY b.n ame.
The SELECT Anderson d, a.n ame, a.c lass_id FROM t_student a JOIN t_class b ON a.c lass_id=b.i d ORDER BY b.n ame.
  • Related