Bugs item #2604583, was opened at 2009-02-16 14:35
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2604583&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: z lh (zlh)
Assigned to: Nobody/Anonymous (nobody)
Summary: the count() return null while expect 0

Initial Comment:
--the count() return null while expect 0
create table t1( a int , b int ) ; 
insert into t1 values ( 3, 1 ) , ( 4, 2 ) , ( 5, 3 ) , ( 6, 4 ) , ( 7, 5 ) ;  

select * from t1; 
select ( select count( * )+1 
         from t1 as tt3 
         where tt3.b < tt2.b )
from t1 as tt2 ; 

---------------------------------
--the result : the last SQL should returns 1,2,3,4,5 , not null,2,3,4,5
sql>create table t1( a int , b int ) ; 
0 tuples
sql>insert into t1 values ( 3, 1 ) , ( 4, 2 ) , ( 5, 3 ) , ( 6, 4 ) , ( 7, 5 ) 
;  
Rows affected 5
sql>
0 tuples
sql>select * from t1; 
+---+---+
| a | b |
+===+===+
| 3 | 1 |
| 4 | 2 |
| 5 | 3 |
| 6 | 4 |
| 7 | 5 |
+---+---+
5 tuples
sql>select ( select count( * )+1 
more>         from t1 as tt3 
more>         where tt3.b < tt2.b )
more>from t1 as tt2 ; 
+-----------------+
| sql_add_count_b |
+=================+
|            null |
|               2 |
|               3 |
|               4 |
|               5 |
+-----------------+
5 tuples


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2604583&group_id=56967

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to