sql strange, VSTUDIO and V4MD 4.3

Ivan Smahin ivan_smahin at paradigmasoft.com
Mon Jun 14 06:32:15 CDT 2010


Hello Ivan,

Monday, June 14, 2010, 2:25:23 PM, you wrote:


>> in this example, I have only 3 records, but, in practice, I can have 10000 records !!
>> I only want save my order...

> And  you  do something like "...IN (7, 23, 1, ... thousand times ...)"
> ???

> It would be pretty slow query...

> Ok, how do you know that you need exactly such order - 7, 23, 1 ...?
> I  guess  you  get  that  recIDs from another queries. So you might do
> something like this:

> select recID, scrap from tableScrap where recID IN ( select RecID from
> tableScrap where <your conditions>)

> or even redesign it to join which is more speedy in most cases.

> Anyway sort order in the result is undefined following sql-standard.
> Valentina  do  a  lot  of tricks to run the query as fast as possible.
> Some of them based on idea of undefined order.

> To  get  some  particular order you should use "order by" clause.

I  mean  you need some extra field to keep the order and then you will
be able to sort it out



-- 
Best regards,
Ivan Smahin 
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com



More information about the Valentina mailing list