Expand|Select|Wrap|Line Numbers
- SELECT switch, COUNT(*) as "Servers", 20 - COUNT(*) as "Spare slots"
- from dedicated_servers
- where switch like 'rs%'
- GROUP by switch HAVING COUNT(switch) < 20
- order by Servers;switch like 'rs%' GROUP by switch
- HAVING COUNT(switch)
Expand|Select|Wrap|Line Numbers
- +-------------+---------+-------------+
- | switch | Servers | Spare slots |
- +-------------+---------+-------------+
- | rsj14-1.dc | 12 | 8 |
- | rsj12-1.dc | 15 | 5 |
- | rsi2-2.dc | 16 | 4 |
- | rsj13-1.dc | 16 | 4 |
- | rsi2-1.dc | 16 | 4 |
- +-------------+---------+-------------+
I only have SELECT access so creating a new column or something like that isn't really an option. i've found this hard mainly because my sum column isn't part of the DB... Thanks in advance for your help boys n' girls.