Sql statement [message #370810] |
Thu, 10 February 2000 13:34 |
newcomer
Messages: 3 Registered: February 2000
|
Junior Member |
|
|
I have a table like this
Product
pno
p1
p1
p1
p2
I want a sel statement which can display a output
as
p1 - 3 - 2
p2 - 1 - 2
where 2 stands for 2 unique records (p1,p2)
|
|
|
Re: Sql statement [message #370819 is a reply to message #370810] |
Fri, 11 February 2000 00:22 |
Atavur Rahaman S.A
Messages: 23 Registered: January 2000
|
Junior Member |
|
|
Hello,
Good Day!
Hope so this'll work.....
SQL> Select Product_Id, Count(*) Number of Products, Count(*)-1 Redundant Products From
Table_Name Group By Product_id;
Regards
Atavur Rahaman S.A
|
|
|
Re: Sql statement [message #370835 is a reply to message #370810] |
Mon, 14 February 2000 15:31 |
Suresh
Messages: 189 Registered: December 1998
|
Senior Member |
|
|
try this
select a.pno,count(distinct(a.rowid)),count(distinct(b.pno)) from product a,product b
group by a.pno
Suresh
|
|
|