pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shyju Narayanan <shyjukoyyam@gmail.com>
To: pgsql-sql@postgresql.org
Subject: sql
Date: Fri, 2 Feb 2007 13:09:09 +0530
Message-ID: <fecb4bb00702012339t135143d8v42e5cd6c834fca09@mail.gmail.com> (raw)

Hi All

 this is my table ;
| ID    |entry_user_id_int  | category_id_chv |
----------------------------------------------
| 1        |        78            |    CV              |
----------------------------------------------
| 2        |        78            |    VC              |
----------------------------------------------
| 3        |        78            |    CV            |
----------------------------------------------
| 4        |        78            |    CV            |
----------------------------------------------
| 5        |        78            |    CV            |
----------------------------------------------
| 6        |        78            |    CV            |
----------------------------------------------
| 7        |        78            |    CV            |
----------------------------------------------
| 8        |        78            |    CV            |
----------------------------------------------
| 9        |        78            |    VE            |
----------------------------------------------
| 10    |        78            |    CV            |
----------------------------------------------
| 11    |        78            |    SC            |
----------------------------------------------

WHEN "select entry_user_id_int, category_id_chv,count(category_id_chv) from
vigilance_master group by category_id_chv,entry_user_id_int having"
entry_user_id_int=78
result is :

ID   entry_user_id_int  category_id_chv count

1        78                       VC                     1
2        78                       VE                     1
3        78                       CV                     8
4        78                       SC                     1

BUT I NEED THE RESULT AS
entry_user_id_int     COUNT(VC)  COUNT(VE)  COUNT(CV)   COUNT(SC)  TOTAL
 78        1 1 8 1 11

view thread (20+ messages)  latest in thread

Message-ID: <fecb4bb00702012339t135143d8v42e5cd6c834fca09@mail.gmail.com>
Permalink:  ../fecb4bb00702012339t135143d8v42e5cd6c834fca09@mail.gmail.com/
Also on:    postgresql.org/message-id/fecb4bb00702012339t135143d8v42e5cd6c834fca09@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: shyjukoyyam@gmail.com
  Subject: Re: sql
  In-Reply-To: <fecb4bb00702012339t135143d8v42e5cd6c834fca09@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox