I have folowing sql query
select sta_name Station,count(factory_name) as factories from gps1
group by sta_name
order by sta_name
Through this query i am getting only total factories in a single Station.Problem is that i want to get the the result in the shape that factory number should also dispalye out of total factories in Station For Exampel If a Station has 5 factoreies then Five Factories should have this output
1/5
2/5
3/5
4/5
5/5
Any one please help me to get this type of result
UPdate
I Want this output
for example i have 5 factories in a station station1
factoryName Count
factroty 1 1/5
factroty 2 2/5
factroty 3 3/5
factroty 4 4/5
factroty 5 5/5
Turn the count into an analytic function and remove the grouping:
Of course, if you want it like
1/5then change it to:EDIT: To mark it as, say, ‘1 out of 5’, ‘2 out of 5’, etc. then you can add a
row_number: