[sqlite] select ... where problem

2012-09-20 Thread
insert into history (mdwkup,macdup,mdate,mdwkmd) SELECT 
(select count(*) FROM fxj where mdwkup=1),
 (select CURDATE()),
(select round(avg(mdwkmd),2) from fxj) where datetime('now',
'localtime')>15:00

The sql command could not run

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


[sqlite] how to update the Moving average value

2012-08-11 Thread
I hace many record of product database,and wanna count the moving average
value of sales_vol of last 3 days(id) of value, how to write sql command? 

id  Sales_vol  mov_avg
1 1 
2 2 
3 3   =(1+2+3)/3
4 5   =(2+3+5)/3
5 4   =(3+5+4)/3
6 2   =(5+4+2)/3
7
...



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


[sqlite] How to run sql file in c++?

2012-06-17 Thread
How to run sql file in c++?
I have a sql file contain any sql cmd and I will run the sql cmd file in
c++,
And I know use .read in sqlite shell cmd,but how to run the cmd in c++?

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


[sqlite] how to update the select commad

2012-05-06 Thread
update dzhhq set mnote=
case when  (select dzhhq.*,b.bs from dzhhq inner join (select bs,stkcode
from buysell) b on dzhhq.stkcode=b.stkcode) then 'sell'||mnote
else mnote
end
this command:
(select dzhhq.*,b.bs from dzhhq inner join (select bs,stkcode from buysell)
b on dzhhq.stkcode=b.stkcode);
Could searched the result 
But how to update

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