[sqlite] How to Online Backup In-Memory DB with SQL?

2010-10-30 Thread zhangzhenggui
SQLite Online Backup API such as sqlite3_backup***, it's very convenient to 
backup In-Memory DB to disk. 

If sqlite also provide SQL to do this, it will bring more convenience for some 
scenarios, such as pysqlite in python.


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Why select count(distinct f1, f2) fro m tbl_test can not work?

2010-06-26 Thread zhangzhenggui
tbl_test maybe like this:
create table tbl_test(f1, f2, f3);

Now, I want to get the num of records which (f1, f2) are distinct.

I try select count(distinct f1, f2) from tbl_test, but error occur: SQL 
error: wrong number of arguments to function count()


although, I can do like this, but I think it not very good :
select count(1) from (select distinct f1, f2 from tbl_test);



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem with cast(xx as YY)

2009-12-25 Thread zhangzhenggui
 Don't complain that SQLite's cast works the other way than SQL Server
 or MySQL. SQLite behaves in a very unique way when the type-related
 matters are a concern. And you better tell as how behavior of cast()
 is different from 3.3.4.

Thanks a lot!
Actually, The 'select' return same result in 3.3.4.

Anyway, I trust sqlite. 
 





___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Problem with cast(xx as YY)

2009-12-24 Thread zhangzhenggui
Dear Friend,

My sqlite version is 3.6.21. I find that, the behavior of cast(XX as YY) 
is not the same as other DBMS, such as SQL Server, MYSQL.

This is my test:
 create table t(f1);
 insert into t values('1');
 
 select * from t where cast(f1 as int) = 1 and f1 = '1'; 
 select * from t where f1 = '1' and cast(f1 as int) = 1;
 
 The results of ths two 'select' are different. The first 'select' gets 
nothing and the second 'select' gets one record. 
 The value of f1 is changed to int type after call cast(f1 as int). 
 The behavior of cast(XX as YY) is not the same as the old version, such 
as 3.3.4, and also different to SQL Server or  MYSQL.
 
 Is this a bug? or a characteristic of sqlite?
 
 I hope for your response, thanks.
 Thanks a again.
 
 
Thanks
zhangzhenggui


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users