Avatar of v s
v s

asked on 

what will be mysql query to display result as i required ?? ( counting records and display count for each category)

There are four Categories of employee

Each Category has certain Posts

there are three tables
Category master (category will be selected from here) [CategoryId]
designationmaster [DesignationId] [Category]
employee master [Designation]

CategoryId = Category
 DesignationId = Designation

i want to display data as per category selected from dropdown menu
for example i have selected DRDS
Under DRDS following are post like  Sc. B   Sc. C     Sc .D  Sc .E  etc

i want to display number of emloyees in every post of selected category

For example if I select DRDS Output should be like this
  HELD is number of employees of that post

RANK         HELD
Sc. H           01
Sc. G           07
Sc. F           05
Sc. E           02
Sc .D          10
Sc. C          15
Sc .B          07

similarly if i select DRTC  Output should be like this

RANK         HELD
TO D           03
TO C           33
TO B           35
TO A           29

Screenshots of tables are attached.

what will be the mysql query for this ??
how to fetch data from this query and display its count for every post of certain category
DatabasesWeb DevelopmentPHPMySQL ServerSQL

Avatar of undefined
Last Comment
Julian Hansen

8/22/2022 - Mon