Home > database > SQL researchers sorted according to the department
SQL researchers sorted according to the department
Time:09-21
Staff table
Workuser ID UserID DeptID
Corresponding department table Dept
ID Name ParentID Headquarters in 1 0 2 development 1 3 marketing 1 4 department of 0 5 customer service 4
Hope to be able to achieve according to the department personnel sort Which department is divided into primary and secondary department First cycle level of department personnel, recycling secondary department personnel Who can help me, very urgent...
CodePudding user response:
Help ah, how have no one to talk to
CodePudding user response:
Headquarters and division level department, other three are the secondary sector
CodePudding user response:
First you send up to look at it, table structure associated two tables, and then order by line
CodePudding user response:
Don't know whether you have to be like this: The select d.n ame, u.u serid The from dept d, workuser u Where d.i d=u.d eptid The order by d.i d ;