-
Hi!
My want to count only those buyer who appear more then 1 (> 1)
What should be my sql statment.
select count(distinct(buyer)) from xxxx.
This will not work because it counts buyer who appear once.
(how can I ommit buyer who appear once)
-
Code:
SELECT
COUNT(*)
FROM
(
SELECT
BUYER
FROM
XXXX
GROUP BY
BUYER
HAVING
COUNT(*) > 1
)
- Chris
-
I can not do that because my query is very big and this is just one of the field.
i.e.
select
td.time_dt Todate,
ofr_grp_nm GroupName,
ofr_grp_dt GroupDate,
max(ofr_close_dt)CloseDate,
count(distinct(it.item_sku)) ItemSKU,
sum(ofr_list_qty) ListQty,
sum(ofr_close_qty) CloseQty,
count(ofr_win_oid) NoOfWins,
sum(ofr_close_cost) CloseRev,
from xxxx
where condition
-
Perhaps if you want an answer to your exact question you would actually post it first?
-
Maybe if you followed your duplicate thread, you would have the answer by now.
http://www.dbasupport.com/forums/sho...threadid=19771
Jeff Hunter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|