On Tue, May 29, 2012 at 6:05 AM, IQuant wrote:
>>CREATE VIEW TICKMAX
>>AS
>> SELECT ASK, BID, TRADEPRICE, TIMESTAMP, SYMBOL
>> FROM TICKDATA
>> WHERE TIMESTAMP = MAX(TIMESTAMP)
>>GROUP BY SYMBOL;
>
> Trying to work through your suggestions:
> I'm getting "Misuse of
Keith,
Trying to work through your suggestions:
I'm getting "Misuse of aggregate max()"
>CREATE VIEW TICKMAX
>AS
> SELECT ASK, BID, TRADEPRICE, TIMESTAMP, SYMBOL
>FROM TICKDATA
> WHERE TIMESTAMP = MAX(TIMESTAMP)
>GROUP BY SYMBOL;
___
On 29 May 2012, at 1:16am, IQuant wrote:
> I may try a 2 pass approach: Pass 1 update query to record the rowid
> of the previous symbol record and pass 2 use a join for performing the
> IQ calcs.
Yep. Just do it in your programming language. One SELECT to find the
Not sure how to combine the subqueries.
Our TickData table looks close to: TimeStamp, Symbol, Ask, Bid, Last
... IQ_A, IQ_B, IQ_T, IQ_X
We need to update the IQ fields with calculations always made between
the current record and previous symbol record ordered by timestamp. I
don't know how to
l Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On Behalf Of
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Update Query
>
>
>
>
> Simon.
> ___
> sq
On 25 May 2012, at 3:04am, IQuant wrote:
> update TICKDATA set IQ_A = ROUND(ASK - (
> select t2.ASK from TICKDATA t2
> where t2.SYMBOL = TICKDATA.SYMBOL and t2.TIMESTAMP <
> TICKDATA.TIMESTAMP ORDER BY T2.SYMBOL, t2.timestamp DESC LIMIT 1),4),
> IQ_B = ROUND(BID - (
>
Thanks for your suggestion Igor Tandetnik:
Scope creep expanded the original query to the actual trading
instruments and the refactored code has evolved to::
update TICKDATA set IQ_A = ROUND(ASK - (
select t2.ASK from TICKDATA t2
where t2.SYMBOL = TICKDATA.SYMBOL and t2.TIMESTAMP <
Thanks for ur equivalent query.
Its working as expected
using rowid will not be prob rightAs long as its value is unique.
Regards,
Thiru.
On Sun, Apr 19, 2009 at 8:33 PM, Igor Tandetnik wrote:
> "thirunavukarasu selvam"
> wrote in message
>
status is basically used for display
Always new row is added with status 0
Once its been displayed the status has to be changed to 1. Its just to track
of rows displayed and new added rows.
On Sun, Apr 19, 2009 at 12:51 PM, John Machin wrote:
> On 19/04/2009 5:06 PM,
"thirunavukarasu selvam"
wrote in message
news:5b5250670904190006h7faba51ejbd9c392c0584c...@mail.gmail.com
> I need a help in using update query along with limit option.
> I tried the following query
> update table-name SET status='1' where status='0' limit 2
> status - column
On 19/04/2009 5:06 PM, thirunavukarasu selvam wrote:
> I tried the following query
> update table-name SET status='1' where status='0' limit 2
> status - column name.
What is "status - column name" meant to do?
> I am using sqlite-amalgamation-3.6.13.tar.gz source from sqlite.org.
>
> I
Hello all,
Am new to sqlite.
I need a help in using update query along with limit option.
I tried the following query
update table-name SET status='1' where status='0' limit 2
status - column name.
I need to update the value of status columns having value 0 to value 1. That
too for only 2
On Sat, 2005-01-22 at 11:50 -0500, Luc Vandal wrote:
> Perhaps Iâm not doing things correctly, but this code will take about 1
> minute to execute (2400 records on a total of around 44000 records):
>
> for(INT nCurrRow=1;nCurrRow<=nRows;nCurrRow++)
>
Gwendolynn ferch Elydyr wrote:
I seem to recall that there was a significant performance difference
between using sqlite3_exec vs prepared statements. You might try
using sqlite3_prepare/bind/finalize.
I would add that you need to do all of your database retreiving before
starting the updating.
On Sat, 22 Jan 2005, Luc Vandal wrote:
Wrap he updates in a transaction.
I'm already doing that (unless I'm doing it wrong?):
nRet = sqlite3_exec( m_pDB, _T("BEGIN;"), 0, 0, );
...
nRet = sqlite3_exec( m_pDB, _T("COMMIT;"), 0, 0, );
I seem to recall that there was a significant performance
Luc Vandal wrote:
Hi,
Perhaps I’m not doing things correctly, but this code will take about 1
minute to execute (2400 records on a total of around 44000 records):
Wrap he updates in a transaction.
See http://www.sqlite.org/lang_transaction.html for the syntax.
--
Scott Wilkinson
MICROS
Hi,
Perhaps Im not doing things correctly, but this code will take about 1
minute to execute (2400 records on a total of around 44000 records):
Basically, Im getting records that need to be updated. Then, I go through
each record and update it. Should be fast IMHO but I dont see why its
17 matches
Mail list logo