ge-
>From: sqlite-users [mailto:sqlite-users-
>boun...@mailinglists.sqlite.org] On Behalf Of nitpi...@arcor.de
>Sent: Monday, 30 October, 2017 10:51
>To: SQLite mailing list
>Subject: Re: [sqlite] calculation with the result of two select
>results
>
>Hi Richard,
>
>I
Yes, so the two strftimes for now are called once beforehand, and then
indeed each row is visited and strftime calculated.
If you want you can create an expression index for the strftime and
then lookups will be super fast at the cost of some index space.
On 10/30/17, nitpi...@arcor.de wrote:
>
Hi Richard,
I'm not sure, what You mean.
My intention was to drop the seconds while finding the correct rows. The data
for the records is collected by a perl script and this stores the records
sometimes at hh:mm:09 sometimes at hh:mm:10.
The timestamp is assigned automaticly while creating usin
On 10/30/17, Wout Mertens wrote:
>> WHERE STRFTIME('%Y-%m-%d %H:%M', timestamp) = STRFTIME('%Y-%m-%d %H:%M',
> 'now', 'localtime', '-1 minute');
>
> Won't this run strftime on all rows? Unless you have a calculated index on
> that strftime function, I think you should convert the 'now' to a timest
> WHERE STRFTIME('%Y-%m-%d %H:%M', timestamp) = STRFTIME('%Y-%m-%d %H:%M',
'now', 'localtime', '-1 minute');
Won't this run strftime on all rows? Unless you have a calculated index on
that strftime function, I think you should convert the 'now' to a timestamp…
Unless of course your table is 5 row
On Monday, 30 October 2017 07:27:38 CET Richard Hipp wrote:
> On 10/30/17, nitpi...@arcor.de wrote:
> > I was trying with parenthesizing but without luck.
> > (SELECT ... ) - (SELECT ... -1 day ...);
>
> You want:
>
> SELECT (SELECT ...)-(SELECT ... -1 day ...);
OMG, so easy!
Thank You very mu
On 10/30/17, nitpi...@arcor.de wrote:
>
> I was trying with parenthesizing but without luck.
> (SELECT ... ) - (SELECT ... -1 day ...);
You want:
SELECT (SELECT ...)-(SELECT ... -1 day ...);
--
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing
Hi gurus,
I have a database from which I get two (integer) values,
one from today and the second from same time yesterday:
SELECT kwh_th FROM werte WHERE STRFTIME('%Y-%m-%d %H:%M', timestamp) =
STRFTIME('%Y-%m-%d %H:%M', 'now', 'localtime', '-1 minute');
SELECT kwh_th FROM werte WHERE STRFTIME('
8 matches
Mail list logo