postgresql count -


Can it be done in PGSQL? I have a scene that I made where the host name, IP, and datacenter from a table, and ifdesc and if data from another table. View output looks like this:

  hostname | IP | Datacenter | Ifdesc | Ifadminstat | Ifoperstat | ---------- ---------------------------------------- -------------------------- R1 1.1.1.1 DC Gigabit Ethernet 1/1 2 1 R1 1.1.1.1 DC Gigabit Ethernet 1/2 2 2 R 1 1.1.1.1 DC GigabitEthernet1 / 3 2 2 r1 1.1.1.1 DC GigabitEthernet1 / 4 2 1 r1 1.1.1.1 DC GigabitEthernet2 / 1 2 2 r1 1.1.1.1 DC GigabitEthernet2 / 2 2 2 r2 2.2.2.2 DC GigabitEthernet1 / 1 2 2 r2 2.2.2.2 DC GigabitEthernet1 / 2 2 2  

I for each router (for example, for all the interfaces on each blade "ifadminstat = 2" and "ifoperstat = 2 "need to get the count .. For r1, how many interfaces on blade 1 (GigabitEthe rnet1 / 1-48) is "ifadminstat = 2" and "ifoperstat = 2".

I try to count the results presented Postgresql HP using P website. < / P>

  select hostname, IP count (1) table where ifadminstat = 2 and Host name From, IP  
ifoperstat = 2 group

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -