|
|
How to count number of distinct rows
Hi all
I want to count the number of distinct rows. how to rewrite below
query ?
select distinct modifyts_date, sync_last_begin_date from
pub.order_sync;
.....
....
2007-09-06 2007-09-07
2007-09-07 2007-09-07
2007-09-08 2007-09-08
2007-09-08 2007-09-09
2007-09-09 2007-09-09
2007-09-10 2007-09-10
2007-09-11 2007-09-11
2007-09-11 2007-09-13
2007-09-12 2007-09-12
2007-09-12 2007-09-13
2007-09-13 2007-09-13
2007-09-14 2007-09-14
2007-09-17 2007-09-17
|
|
0
|
|
|
|
Reply
|
moon_ils-se (53)
|
9/21/2007 8:38:58 AM |
|
moonhk wrote:
> Hi all
>
> I want to count the number of distinct rows. how to rewrite below
> query ?
>
> select distinct modifyts_date, sync_last_begin_date from
> pub.order_sync;
>
> ....
> ...
> 2007-09-06 2007-09-07
> 2007-09-07 2007-09-07
> 2007-09-08 2007-09-08
> 2007-09-08 2007-09-09
> 2007-09-09 2007-09-09
> 2007-09-10 2007-09-10
> 2007-09-11 2007-09-11
> 2007-09-11 2007-09-13
> 2007-09-12 2007-09-12
> 2007-09-12 2007-09-13
> 2007-09-13 2007-09-13
> 2007-09-14 2007-09-14
> 2007-09-17 2007-09-17
SELECT COUNT(DISTINCT modifyts_date, sync_last_begin_date)
FROM pub.order_sync;
|
|
0
|
|
|
|
Reply
|
Paul
|
9/21/2007 11:04:21 AM
|
|
On 9 21 , 7 04 , "Paul Lautman" <paul.laut...@btinternet.com> wrote:
> moonhk wrote:
> > Hi all
>
> > I want to count the number of distinct rows. how to rewrite below
> > query ?
>
> > select distinct modifyts_date, sync_last_begin_date from
> > pub.order_sync;
>
> > ....
> > ...
> > 2007-09-06 2007-09-07
> > 2007-09-07 2007-09-07
> > 2007-09-08 2007-09-08
> > 2007-09-08 2007-09-09
> > 2007-09-09 2007-09-09
> > 2007-09-10 2007-09-10
> > 2007-09-11 2007-09-11
> > 2007-09-11 2007-09-13
> > 2007-09-12 2007-09-12
> > 2007-09-12 2007-09-13
> > 2007-09-13 2007-09-13
> > 2007-09-14 2007-09-14
> > 2007-09-17 2007-09-17
>
> SELECT COUNT(DISTINCT modifyts_date, sync_last_begin_date)
> FROM pub.order_sync;- -
>
> - -
Thank, Our version sql not support below.
SQLExplorer>SELECT COUNT(DISTINCT modifyts_date,
sync_last_begin_date)
1> from pub.order_sync;
=== SQL Exception 1 ===
SQLState=42000
ErrorCode=-20003
[JDBC Progress Driver]:Syntax error (7587)
SQLExplorer>
|
|
0
|
|
|
|
Reply
|
moonhk
|
9/24/2007 4:28:25 AM
|
|
On 9 24 , 12 28 , moonhk <moon_ils...@yahoo.com.hk> wrote:
> On 9 21 , 7 04 , "Paul Lautman" <paul.laut...@btinternet.com> wrote:
>
>
>
>
>
> > moonhk wrote:
> > > Hi all
>
> > > I want to count the number of distinct rows. how to rewrite below
> > > query ?
>
> > > select distinct modifyts_date, sync_last_begin_date from
> > > pub.order_sync;
>
> > > ....
> > > ...
> > > 2007-09-06 2007-09-07
> > > 2007-09-07 2007-09-07
> > > 2007-09-08 2007-09-08
> > > 2007-09-08 2007-09-09
> > > 2007-09-09 2007-09-09
> > > 2007-09-10 2007-09-10
> > > 2007-09-11 2007-09-11
> > > 2007-09-11 2007-09-13
> > > 2007-09-12 2007-09-12
> > > 2007-09-12 2007-09-13
> > > 2007-09-13 2007-09-13
> > > 2007-09-14 2007-09-14
> > > 2007-09-17 2007-09-17
>
> > SELECT COUNT(DISTINCT modifyts_date, sync_last_begin_date)
> > FROM pub.order_sync;- -
>
> > - -
>
> Thank, Our version sql not support below.
> SQLExplorer>SELECT COUNT(DISTINCT modifyts_date,
> sync_last_begin_date)
> 1> from pub.order_sync;
> === SQL Exception 1 ===
> SQLState=42000
> ErrorCode=-20003
> [JDBC Progress Driver]:Syntax error (7587)
> SQLExplorer>- -
>
> - -
I get it using view and count
SQLExplorer>create view er as select distinct modifyts_date,
sync_last_begin_date from pub.order_sync;
SQLExplorer>select count(*) from er;
count(*)
-----------
1311
SQLExplorer>
|
|
0
|
|
|
|
Reply
|
moonhk
|
9/24/2007 7:50:47 AM
|
|
|
3 Replies
178 Views
(page loaded in 0.399 seconds)
Similiar Articles: count number of rows in a file - comp.soft-sys.matlab... comp.databases.mysql ... count number of rows in a file - comp.soft-sys.matlab Fast way to do "SELECT count(*) FROM table" - comp ... How to count number of distinct rows ... Macro SAS - counting rows. - comp.soft-sys.sasHi. I=B4m triying to count the number of rows of a table without using the "select count" command but I dont know wich is the command to do this. ... Fast way to do "SELECT count(*) FROM table" - comp.databases.mysql ...Hello. I start to write a simple Database management tool and i want to display the number of rows in a table. Unfortunately MySQL is extremely slow o... Fast way to do "SELECT count(*) FROM table" - comp.databases.mysql ...... default order,it is very slow ,like 50s,is it have the fast way to get count number ... to write a simple Database management tool and i want to display the number of rows in ... How to count how many times ech row has been repeated? - comp.soft ...... have a matrix consisting of a large number of rows. I ... How to get latest date for each distinct entry? - comp.databases ... How to count how many times ech row has been ... count rows - comp.lang.awki have some number of rows in a file. i just want a count of the number of rows in file using a predefined variable. The variable NR gives only the cu... How to get latest date for each distinct entry? - comp.databases ...... observation >>> 'dates' of every distinct ... How to count the number of unique entry of one field ... How to count how many times ech row has been repeated? - comp.soft ... How to count number of unique element(s) in a vector? - comp.soft ...Once you have that, I think it's straightforward to count the number of elements. ... every elements of a vector ... of the unit delay and the ... should be a row ... Textarea max rows and max characters per row - comp.lang ...Word wrapping visually shows multiple rows however it is still the same row. So to limit number of rows, simply count how much new line characters there are. Table with 400000 rows takes a long time to count - comp.databases ...So to limit number of rows, simply count how much new line characters there are. ... to single row - comp.soft-sys.matlab ..... your situation correctly, each time ... How to count number of distinct rows - Database Support @ dbaspot ...Hi all I want to count the number of distinct rows. how to rewrite below query ? select distinct modifyts_date, sync_last_begin_date from pub.order_sync ... Re: [SQL] Counting the number of distinct rows returnedAt 16:56 +0300 on 19/08/1999, Sejin Oh wrote: > yeah... GROUP BY should do.. > > try this: > > SELECT COUNT(*) FROM sales_by_region GROUP BY user_id; No, no, it ... 7/25/2012 1:16:49 PM
|
|
|
|
|
|
|
|
|