Re: [sqlite] getting only count of records

2005-10-26 Thread Guillaume MAISON
Wilfried Mestdagh a écrit : Hi Guillaume, if restricting in the where clause on VehicleID, then you should create an index on VehicleID. I' not sure I understeand correct. Does this mean that if I uses 'where' clauses it is not needed to make indexes and it make index itself when needed ? N

Re[2]: [sqlite] getting only count of records

2005-10-25 Thread Wilfried Mestdagh
Hi Guillaume, > if restricting in the where clause on VehicleID, then you should create > an index on VehicleID. I' not sure I understeand correct. Does this mean that if I uses 'where' clauses it is not needed to make indexes and it make index itself when needed ? By now I have made an index on

RE: [sqlite] getting only count of records

2005-10-25 Thread Brandon, Nicholas
>Is this the right way to do or is there a better way ? In addition to the comments others have made, I would suggest you use: 'select count(*) from tx where VehicleID = ' + QuotedStr(VehicleID) 'count(*)' is a special case for the count function that returns "count of records". In terms of p

Re: [sqlite] getting only count of records

2005-10-25 Thread Arjen Markus
Wilfried Mestdagh wrote: > > Hi Arjen, > > AM> No, they will probably not all do the same internally: the result > AM> may be the same, but the "virtual machine" that runs the SQL statements > AM> will very probably do different things - this depends on optimisation > AM> and so on. But for most

Re: [sqlite] getting only count of records

2005-10-25 Thread Guillaume MAISON
Wilfried Mestdagh a écrit : AM> No, they will probably not all do the same internally: the result AM> may be the same, but the "virtual machine" that runs the SQL statements AM> will very probably do different things - this depends on optimisation AM> and so on. But for most of us it is mainly th

Re[2]: [sqlite] getting only count of records

2005-10-25 Thread Wilfried Mestdagh
Hi Arjen, AM> No, they will probably not all do the same internally: the result AM> may be the same, but the "virtual machine" that runs the SQL statements AM> will very probably do different things - this depends on optimisation AM> and so on. But for most of us it is mainly the result that count

Re: [sqlite] getting only count of records

2005-10-25 Thread Arjen Markus
Wilfried Mestdagh wrote: > > Hi Guillaume and Martin, > > Thanks for quick responce. Studying the count() function if I use the > method of Guillaume I dont need the 'where' clause: > > 'select count(VehicleID) from tx' > > But I assume all 3 methods will do internal exact the same. Result is

Re: [sqlite] getting only count of records

2005-10-25 Thread Wilfried Mestdagh
Hi Guillaume and Martin, Thanks for quick responce. Studying the count() function if I use the method of Guillaume I dont need the 'where' clause: 'select count(VehicleID) from tx' But I assume all 3 methods will do internal exact the same. Result is also 1 field with the count in it. --- Mvg

Re: [sqlite] getting only count of records

2005-10-25 Thread Guillaume MAISON
Wilfried Mestdagh a écrit : Hello, I want to have only the count of records for a particular 'where clause', need no fields. It works using null as argument: 'select null from tx where VehicleID = ' + QuotedStr(VehicleID) Is this the right way to do or is there a better way ? Hi Wilfried,

Re: [sqlite] getting only count of records

2005-10-25 Thread Martin Engelschalk
Hello Wilfried, your query will have as many result - Rows as meet your where-clause. A Better way will be select count(*) from tx where VehicleID = ' + QuotedStr(VehicleID) This will have one result row with the number of records in the first (and only) column. Martin Wilfried Mestdagh sch

[sqlite] getting only count of records

2005-10-25 Thread Wilfried Mestdagh
Hello, I want to have only the count of records for a particular 'where clause', need no fields. It works using null as argument: 'select null from tx where VehicleID = ' + QuotedStr(VehicleID) Is this the right way to do or is there a better way ? --- Mvg, Wilfried http://www.mestdagh.biz