Message: 25
Date: Thu, 20 Sep 2012 07:44:00 -0600
From: "Keith Medcalf" <kmedc...@dessus.com>
To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org>
Subject: Re: [sqlite] select ... where problem
Message-ID: <dccc8dcdf36303448ae1d39bb3070...@mail.dessus.com>
Content-Type: text/plain; charset="utf-8"


>>> >>> (select CURDATE()),
>>> What is a CURDATE()?  Is that a custom scalar function of your own?  Did 
>>> you remember to compile it into the engine or load the module containing 
>>> the function?
>>> >>> where datetime('now', 'localtime') > 15:00
>>> 15:00 is unparseable.  Perhaps you mean 
>>> >>> where datetime('now', 'localtime') > '15:00'
>>> But if so you can elimate the where clause entirely because '2' is always 
>>> greter than '1' ...
>>> I am surprised the "Error Message" did not point out these errors.

---

 
I means the sql cmd had no "from ", only "select",  "where":


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";


if run this cmd:

insert into history (mdwkmd) 
select round(avg(mdwkmd),2) from fxj where datetime('now',
'localtime')>15:00

will successful.

!!!!!
Sincerely,
Cordialement / Best Regards / Mit freundlichen Grüßen / Cordiali saluti !
___________________________________________
---------------------------------------------------------------------------

YE YANHONG - DASI/DRDS/ITVC/APFS/AVPM
PSA PEUGEOT CITROEN(CHINA) AUTOMOTIVE TRADE CO,. LTD SHANGHAI BRANCH 
Mobile : (+86) 138 1680 8338
Office : (+8621) 2419 5488
PSA internal call: 49 5488
Email: yanhong...@mpsa.com
Address: 5th – 8th floor, A1 Bldg., 1528 Gumei Road,
Xuhui District, Shanghai

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

Reply via email to