i have two tables,
department
———-
deptid (type: INT)
deptname (type: TEXT)
hours (type: INT)
active (type: BIT)
employee
——–
empid (type: INT)
empname (type: TEXT)
deptid (type: INT)
designation (type: TEXT)
salary (type: INT)
now how to make query without using subquery that returns the columns empname and deptname of the employees belonging to those departments that have a head count of 4 or more. The records should be returned in alphabetical order of empname.
Because you have an Aggregate condition (head count of 4 or more), that means without subquery you can not get the
empnamebut onlydeptname.