View previous topic :: View next topic
|
Author |
Message |
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
I have table
COL_NBR PRD_DT
=======================
abc 0001-01-01
def 0001-01-01
abc 2001-01-01
ghi 0001-01-01
I want to count number of rows present in this table where
count of COL_NBR is 1 only.
In output I need
COL_NBR PRD_DT
=======================
def 0001-01-01
ghi 0001-01-01
Please tell me how can I do this |
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
you can try the following query.
Code: |
SELECT COL_NBR,PRD_DT,COUNT(*) AS COUNT1
FROM table
GROUP BY COL_NBR
HAVING COUNT(*) = 1;
|
|
|
Back to top |
|
|
|