This is a discussion on How to count number of distinct rows within the MySQL Database forums, part of the Database Forums category; Hi all I want to count the number of distinct rows. how to rewrite below query ? select distinct modifyts_date, sync_last_begin_date ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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; |
|
|||
|
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> |
|
|||
|
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> |