Re: [sqlite] Better way to get records by IDs

2011-05-24 Thread jose isaias cabrera
"BareFeetWare", on Tuesday, May 24, 2011 8:31 AM wrote... On 23/05/2011, at 11:13 PM, jose isaias cabrera wrote: SharedDB file is about 600 megs shared over a network drive and it's getting slow, but if I get the specific record ID only with the select that I want, it's a lot faster than

Re: [sqlite] Better way to get records by IDs

2011-05-24 Thread BareFeetWare
On 23/05/2011, at 11:13 PM, jose isaias cabrera wrote: > SharedDB file is about 600 megs shared over a network drive and it's getting > slow, but if I get the specific record ID only with the select that I want, > it's a lot faster than getting the select with all the items in one shot. >

Re: [sqlite] Better way to get records by IDs

2011-05-23 Thread jose isaias cabrera
"BareFeetWare", on Saturday, May 21, 2011 9:15 PM wrote... > Hi Jose, > >> I would like to get a bunch of records of IDs that I already know. For >> example, this table called Jobs, >> rec,...,data,... >> 1,...,aaa,... >> 2,...,zzz,... >> ... >> ... >> 99,...,azz,... > > In addition to the pure

Re: [sqlite] Better way to get records by IDs

2011-05-21 Thread BareFeetWare
Hi Jose, > I would like to get a bunch of records of IDs that I already know. For > example, this table called Jobs, > rec,...,data,... > 1,...,aaa,... > 2,...,zzz,... > ... > ... > 99,...,azz,... In addition to the pure syntax answer of other, I suggest you also consider your broader

Re: [sqlite] Better way to get records by IDs

2011-05-20 Thread Jim Morris
If you just need them in descending order, i.e. not an arbitrary order, then "order by rec desc" will work. On 5/20/2011 7:23 AM, jose isaias cabrera wrote: > "Martin Engelschalk" on Friday, May 20, 2011 10:21 AM wrote... > > >> Hi, >> >> to order, you have to use "order by". In that case,

Re: [sqlite] Better way to get records by IDs

2011-05-20 Thread jose isaias cabrera
"Martin Engelschalk" on Friday, May 20, 2011 10:21 AM wrote... > Hi, > > to order, you have to use "order by". In that case, however, it gets > complicated. > > SELECT * FROM Jobs WHERE rec IN (87, 33, 27,2, 1) > order by case rec when 87 then 1 > when 33 then 2 >

Re: [sqlite] Better way to get records by IDs

2011-05-20 Thread Martin Engelschalk
Hi, to order, you have to use "order by". In that case, however, it gets complicated. SELECT * FROM Jobs WHERE rec IN (87, 33, 27,2, 1) order by case rec when 87 then 1 when 33 then 2 when 37 then 3 when 2 then 4 when 1

Re: [sqlite] Better way to get records by IDs

2011-05-20 Thread jose isaias cabrera
"Oliver Peters" on Friday, May 20, 2011 9:47 AM wrote... > jose isaias cabrera writes: > >> >> >> Greetings. >> >> I would like to get a bunch of records of IDs that I already know. For >> example, this table called Jobs, >> rec,...,data,... >> 1,...,aaa,... >> 2,...,zzz,... >>

Re: [sqlite] Better way to get records by IDs

2011-05-20 Thread Oliver Peters
jose isaias cabrera writes: > > > Greetings. > > I would like to get a bunch of records of IDs that I already know. For > example, this table called Jobs, > rec,...,data,... > 1,...,aaa,... > 2,...,zzz,... > ... > ... > 99,...,azz,... > [...] What about SELECT * FROM table

Re: [sqlite] Better way to get records by IDs

2011-05-20 Thread jose isaias cabrera
"Martin Engelschalk", on Friday, May 20, 2011 9:04 AM wrote... > Hi, > > you want this: > > select * from Jobs where rec in (1, 2) > > Martin Darn it! Thanks. And that is easier... :-) > Am 20.05.2011 15:00, schrieb jose isaias cabrera: >> Greetings. >> >> I would like to get a bunch of

Re: [sqlite] Better way to get records by IDs

2011-05-20 Thread Martin Engelschalk
Hi, you want this: select * from Jobs where rec in (1, 2) Martin Am 20.05.2011 15:00, schrieb jose isaias cabrera: > Greetings. > > I would like to get a bunch of records of IDs that I already know. For > example, this table called Jobs, > rec,...,data,... > 1,...,aaa,... > 2,...,zzz,... > ...