Re: [sqlite] View bindings for a statement

2008-04-25 Thread Dennis Cote
Cole Tuininga wrote:
> 
> (tangental question - is it enough to just keep rebinding to a query?
> Or do I need to call sqlite3_clear_bindings every time?). 

There is no need to clear the bindings. If you don't clear the bindings 
you only need to rebind the values that changed.

>  The table
> in question is pretty simple: key/value for the moment.   The select
> looks up a value based on the key.  The thing is that I'm only making
> requests for keys that I know exist, and this doesn't seem to be
> giving me any results.  That is, sqlite3_step is returning SQLITE_DONE
> after the first call each time I run it.
> 
> I'm making sure to call sqlite3_reset on the handle each time.
> 
> The question is, is there an easy way to extract the actual query
> (with the bound variable set) from the statement handle?  I'm looking
> to make sure that I'm actually binding the expected value into the
> query.  Thanks.
> 

As far as I know, there is no way to get the query with the bound values 
replaced.

However, you can transfer the bindings from one query to another so you 
could transfer the bindings from your query to a simple select with the 
same number of parameters. You do this using the obsolete 
sqlite3_transfer_bindings() API (see 
http://www.sqlite.org/c3ref/aggregate_count.html)

Say you have a select that uses three parameters

 select a, b, c from t1 where b < ?1 and c > ?2 or d = ?3

You can prepare a select like this

 select ?1, ?2, ?3

and then transfer the bindings from the first select to the second. When 
you run the second query it will return the values you bound to the 
first query before calling sqlite3_transfer_bindings().

HTH
Dennis Cote

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] View bindings for a statement

2008-04-25 Thread Cole Tuininga
On Fri, Apr 25, 2008 at 4:13 PM, P Kishor <[EMAIL PROTECTED]> wrote:
>
> On 4/25/08, Cole Tuininga <[EMAIL PROTECTED]> wrote:
>  Here is what I do in the Perl world for this problem --
>
>  # Create a string with the bound vars to write to a log
>  $sql = "SELECT col FROM table WHERE col = '';
>  # Write this $sql to a log file
>  $log->info(localtime . ": " . $sql . "\n");
>
>  # Now bind and run the query for real
>  $sth = $dbh->prepare(qq{SELECT col from table WHERE col = ?});
>  $sth->execute('');

I see where you're coming from.  This does do what I asked, but I
think I didn't explain what my concern was very well.  :)

I did try printing out the key.  In fact, I then threw it into a perl
one-liner to pull the data from the same sqlite db and got the row I
was looking for (using DBI).  The thing is that my C is a bit rusty
and I'm not entirely certain that I've got the call right.  It would
probably be useful if I posted a code snippet.  Here are some relevant
snippets from the code.

char **keys;  /* This gets populated dynamically as an array of all
the keys that are in the sqlite database */
const char *q = "SELECT var FROM host_map WHERE ind = ?\0";
sqlite3 *dbh;
sqlite3_stmt *sth;

if (sqlite3_open_v2(INPUT_FILE, , SQLITE_OPEN_READONLY, NULL) !=
SQLITE_OK) {
printf("Did not open the database\n");
return -1;
}

/* Build the query */
if (sqlite3_prepare_v2(dbh, q, -1, , NULL) != SQLITE_OK ) {
printf("Could not compile the query\n");
return -1;
}

index = random() % (long)(lines / 2);
result = sqlite3_bind_text(
sth, 1, (char *) keys[index], strlen((char *)keys[index]) + 1,
SQLITE_TRANSIENT
);

/* Check here to make sure the binding took */

keep_reading = 1;

while (keep_reading) {
switch (sqlite3_step(sth)) {
case SQLITE_ROW:
val = sqlite3_column_text(sth, 0);
printf("%s maps to %s\n", keys[index], val);
break;

case SQLITE_BUSY:
printf("DB was too busy to respond\n");
keep_reading = 0;
break;

case SQLITE_ERROR:
printf("An error has occurred.\n");
return -1;

case SQLITE_MISUSE:
printf("Programming error!\n");
keep_reading = 0;
break;

case SQLITE_DONE:
keep_reading = 0;
break;

default:
printf("Unknown result from sqlite3_step\n");
};
}

-- 
Cole Tuininga
http://www.tuininga.org/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] View bindings for a statement

2008-04-25 Thread P Kishor
On 4/25/08, Cole Tuininga <[EMAIL PROTECTED]> wrote:
> Hi all -
>
>  I'm trying sqlite for the first time and am having a small problem.
>  I'm using the C api.
>
>  I've got a prepared select query that I keep binding new values to
>  (tangental question - is it enough to just keep rebinding to a query?
>  Or do I need to call sqlite3_clear_bindings every time?).  The table
>  in question is pretty simple: key/value for the moment.   The select
>  looks up a value based on the key.  The thing is that I'm only making
>  requests for keys that I know exist, and this doesn't seem to be
>  giving me any results.  That is, sqlite3_step is returning SQLITE_DONE
>  after the first call each time I run it.
>
>  I'm making sure to call sqlite3_reset on the handle each time.
>
>  The question is, is there an easy way to extract the actual query
>  (with the bound variable set) from the statement handle?  I'm looking
>  to make sure that I'm actually binding the expected value into the
>  query.  Thanks.
>

Here is what I do in the Perl world for this problem --

# Create a string with the bound vars to write to a log
$sql = "SELECT col FROM table WHERE col = '';
# Write this $sql to a log file
$log->info(localtime . ": " . $sql . "\n");

# Now bind and run the query for real
$sth = $dbh->prepare(qq{SELECT col from table WHERE col = ?});
$sth->execute('');

>
>  --
>  Cole Tuininga
>  http://www.tuininga.org/



-- 
Puneet Kishor
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] View bindings for a statement

2008-04-25 Thread Cole Tuininga
Hi all -

I'm trying sqlite for the first time and am having a small problem.
I'm using the C api.

I've got a prepared select query that I keep binding new values to
(tangental question - is it enough to just keep rebinding to a query?
Or do I need to call sqlite3_clear_bindings every time?).  The table
in question is pretty simple: key/value for the moment.   The select
looks up a value based on the key.  The thing is that I'm only making
requests for keys that I know exist, and this doesn't seem to be
giving me any results.  That is, sqlite3_step is returning SQLITE_DONE
after the first call each time I run it.

I'm making sure to call sqlite3_reset on the handle each time.

The question is, is there an easy way to extract the actual query
(with the bound variable set) from the statement handle?  I'm looking
to make sure that I'm actually binding the expected value into the
query.  Thanks.

-- 
Cole Tuininga
http://www.tuininga.org/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Performance statistics?

2008-04-25 Thread Richard Klein
> Richard Klein wrote:
>> Does SQLite have a mechanism, in addition to the
>> ANALYZE statement, for recording and dumping
>> performance statistics?
>>
> 
> What kind of performance statistics are you looking for?
> 
> SQLiteSpy (see 
> http://www.yunqa.de/delphi/doku.php/products/sqlitespy/index) measures 
> the execution time of each SQL statement to help you optimize your SQL.
> 
> Dennis Cote

I was thinking of something like the tools that Oracle provides
to assist with performance monitoring and tuning:  ADDM, TKProf,
Statspack.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Insert date

2008-04-25 Thread Federico Granata
On Linux I get

SQLite version 3.5.6
Enter ".help" for instructions
sqlite> CREATE TABLE Sighting (
   ...>  SightingIdinteger PRIMARY KEY AUTOINCREMENT NOT NULL,
   ...>  SpeciesId integer,
   ...>  LocationIdinteger,
   ...>  SightingDate  date,
   ...>  Note  nvarchar(100)
   ...> );
sqlite> INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note) VALUES
(3005,22,'2/26/2008','New Note');
sqlite> select * from Sighting;
1|3005|22|2/26/2008|New Note


--
[image: Just A Little Bit Of
Geekness]
Le tre grandi virtù di un programmatore: pigrizia, impazienza e arroganza.
(Larry Wall).

On Fri, Apr 25, 2008 at 6:20 PM, Simon Davies <
[EMAIL PROTECTED]> wrote:

> 2008/4/25 lrjanzen <[EMAIL PROTECTED]>:
> >
> > I have the following table
> ...
> > and the following insert
> > INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note)
> > VALUES (3005,22,'2/26/2008','New Note')
> >
> > the insert works EXCEPT the date keeps coming in as NULL! What am I
> doing
> > wrong?
> >
> > Thanks
> > Lonnie
> >
>
> On XP I get
>
> SQLite version 3.4.2
> Enter ".help" for instructions
> sqlite>
> sqlite> CREATE TABLE Sighting (
>...>  SightingIdinteger PRIMARY KEY AUTOINCREMENT NOT NULL,
>   ...>  SpeciesId integer,
>   ...>  LocationIdinteger,
>   ...>  SightingDate  date,
>   ...>  Note  nvarchar(100)
>...> );
> sqlite>
> sqlite> INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note)
>   ...> VALUES (3005,22,'2/26/2008','New Note');
> sqlite> select * from sighting;
> 1|3005|22|2/26/2008|New Note
> sqlite>
>
> What operating system, version, wrapper?
>
> Rgds,
> Simon
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Insert date

2008-04-25 Thread Simon Davies
2008/4/25 lrjanzen <[EMAIL PROTECTED]>:
>
> I have the following table
...
> and the following insert
> INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note)
> VALUES (3005,22,'2/26/2008','New Note')
>
> the insert works EXCEPT the date keeps coming in as NULL! What am I doing
> wrong?
>
> Thanks
> Lonnie
>

On XP I get

SQLite version 3.4.2
Enter ".help" for instructions
sqlite>
sqlite> CREATE TABLE Sighting (
   ...>  SightingIdinteger PRIMARY KEY AUTOINCREMENT NOT NULL,
   ...>  SpeciesId integer,
   ...>  LocationIdinteger,
   ...>  SightingDate  date,
   ...>  Note  nvarchar(100)
   ...> );
sqlite>
sqlite> INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note)
   ...> VALUES (3005,22,'2/26/2008','New Note');
sqlite> select * from sighting;
1|3005|22|2/26/2008|New Note
sqlite>

What operating system, version, wrapper?

Rgds,
Simon
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Insert date

2008-04-25 Thread Scott Baker
Scott Baker wrote:
> lrjanzen wrote:
>> I have the following table
>> CREATE TABLE Sighting (
>>   SightingIdinteger PRIMARY KEY AUTOINCREMENT NOT NULL,
>>   SpeciesId integer,
>>   LocationIdinteger,
>>   SightingDate  date,
>>   Note  nvarchar(100)
>> );
>>
>> and the following insert
>> INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note)
>> VALUES (3005,22,'2/26/2008','New Note')
>>
>> the insert works EXCEPT the date keeps coming in as NULL! What am I doing
>> wrong?
> 
> The date/time documentation details all the formats that SQLite 
> understands. You probably just want: -MM-DD.

I guess I should include a URL:

http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions

-- 
Scott Baker - Canby Telcom
RHCE - System Administrator - 503.266.8253
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Insert date

2008-04-25 Thread Scott Baker
lrjanzen wrote:
> I have the following table
> CREATE TABLE Sighting (
>   SightingIdinteger PRIMARY KEY AUTOINCREMENT NOT NULL,
>   SpeciesId integer,
>   LocationIdinteger,
>   SightingDate  date,
>   Note  nvarchar(100)
> );
> 
> and the following insert
> INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note)
> VALUES (3005,22,'2/26/2008','New Note')
> 
> the insert works EXCEPT the date keeps coming in as NULL! What am I doing
> wrong?

The date/time documentation details all the formats that SQLite 
understands. You probably just want: -MM-DD.

-- 
Scott Baker - Canby Telcom
RHCE - System Administrator - 503.266.8253
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Insert date

2008-04-25 Thread Emilio Platzer
try inserting year/month/day

Emilio

>
> I have the following table
> CREATE TABLE Sighting (
>   SightingIdinteger PRIMARY KEY AUTOINCREMENT NOT NULL,
>   SpeciesId integer,
>   LocationIdinteger,
>   SightingDate  date,
>   Note  nvarchar(100)
> );
>
> and the following insert
> INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note)
> VALUES (3005,22,'2/26/2008','New Note')
>
> the insert works EXCEPT the date keeps coming in as NULL! What am I doing
> wrong?
>
> Thanks
> Lonnie
>
> --
> View this message in context:
> http://www.nabble.com/Insert-date-tp16895860p16895860.html
> Sent from the SQLite mailing list archive at Nabble.com.
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Insert date

2008-04-25 Thread lrjanzen

I have the following table
CREATE TABLE Sighting (
  SightingIdinteger PRIMARY KEY AUTOINCREMENT NOT NULL,
  SpeciesId integer,
  LocationIdinteger,
  SightingDate  date,
  Note  nvarchar(100)
);

and the following insert
INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note)
VALUES (3005,22,'2/26/2008','New Note')

the insert works EXCEPT the date keeps coming in as NULL! What am I doing
wrong?

Thanks
Lonnie

-- 
View this message in context: 
http://www.nabble.com/Insert-date-tp16895860p16895860.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Performance statistics?

2008-04-25 Thread Dennis Cote
Richard Klein wrote:
> Does SQLite have a mechanism, in addition to the
> ANALYZE statement, for recording and dumping
> performance statistics?
> 

What kind of performance statistics are you looking for?

SQLiteSpy (see 
http://www.yunqa.de/delphi/doku.php/products/sqlitespy/index) measures 
the execution time of each SQL statement to help you optimize your SQL.

Dennis Cote


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] 3.5.8 alot slower than 3.5.7

2008-04-25 Thread Daniel Önnerby
Thank you!
This helped. didn't find this before.

Best regards
Daniel

Eric Minbiole wrote:
>> This works great but when I upgraded from 3.5.7 to 3.5.8 the speed of 
>> this select went from 0.2s to around 1 minute. And 3.5.8 is stealing 
>> ALOT more memory.
>> 
>
> D. Richard Hipp had a very helpful work-around for this issue, by simply 
> rearranging the terms of your join's ON clause.  Take a look at this 
> thread for details:
>
> http://www.mail-archive.com/sqlite-users%40sqlite.org/msg33267.html
>
> ~Eric
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>   
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] What is faster?

2008-04-25 Thread Federico Granata
If you are under linux you can use "time" command to execute sqlite with
various query and see which one is faster.

--
[image: Just A Little Bit Of
Geekness]
Le tre grandi virtù di un programmatore: pigrizia, impazienza e arroganza.
(Larry Wall).

On Fri, Apr 25, 2008 at 10:04 AM, Alexander Batyrshin <[EMAIL PROTECTED]>
wrote:

>  Hello people,
>
> I have two SQL commands doing the same thing:
> 1.
> SELECT id FROM foo WHERE expr1
> EXCEPT
> SELECT id FROM bar WHERE expr2
>
> 2.
> SELECT id FROM foo WHERE expr1 AND id not IN (SELECT id FTOM bar WHERE
> expr2)
>
>
> Can you say which one is faster? I prefer second option because I can
> use extra condition like LIMIT.
>
> --
> Alexander Batyrshin aka bash
> bash = Biomechanica Artificial Sabotage Humanoid
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] 3.5.8 alot slower than 3.5.7

2008-04-25 Thread Eric Minbiole
> This works great but when I upgraded from 3.5.7 to 3.5.8 the speed of 
> this select went from 0.2s to around 1 minute. And 3.5.8 is stealing 
> ALOT more memory.

D. Richard Hipp had a very helpful work-around for this issue, by simply 
rearranging the terms of your join's ON clause.  Take a look at this 
thread for details:

http://www.mail-archive.com/sqlite-users%40sqlite.org/msg33267.html

~Eric
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] 3.5.8 alot slower than 3.5.7

2008-04-25 Thread Daniel Önnerby
Hi all!
I have a db looking like this: http://onnerby.se/~daniel/mc2db.png
and in my tracks table I have a column named sort_order1. When my 
application is running I try to optimize the database by doing a pretty 
massive SELECT to set this sort_order looking like this:
SELECT t.id FROM tracks t LEFT OUTER JOIN genres g ON 
t.visual_genre_id=g.id LEFT OUTER JOIN albums al ON t.album_id=al.id 
LEFT OUTER JOIN artists ar ON t.visual_artist_id=ar.id LEFT OUTER JOIN 
folders f ON t.folder_id=f.id ORDER BY 
g.sort_order,ar.sort_order,al.sort_order,t.track,f.fullpath,t.filename

This works great but when I upgraded from 3.5.7 to 3.5.8 the speed of 
this select went from 0.2s to around 1 minute. And 3.5.8 is stealing 
ALOT more memory.

I tried this both in my own application and using the sqlite.exe (both 
for 3.5.7 and 3.5.8) and they show the same results.

I tried to locate anything regarding this both on the mailinglist and 
searching tickets.
Is this a known issue or is it a bug?

Best regards
Daniel

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Select by order Speed

2008-04-25 Thread Igor Tandetnik
"Mahalakshmi.m"
<[EMAIL PROTECTED]> wrote
in message
news:[EMAIL PROTECTED]
> My table has records as follows:
>
> Id Track
> 1 zz
> 2 aaa
> 3 cc
> 4 aaa
> 5 aaa
> 6 aaa
>
> 1st 2 records -> SELECT Id, Track FROM MUSIC ORDER BY Track LIMIT 2;
>
> Output: 2 aaa
> 4 aaa
>
> Next 2->SELECT Id, Track FROM MUSIC WHERE Track > aaa ORDER BY Track
> LIMIT 2
>
> Output: 3 cc
> 1 zz
>
> But I want 5 aaa
> 6 aaa

select id, track from music order by track, id limit 2;

select id, track from music
where track>'aaa' or (track='aaa' and id>4)
order by track, id limit 2;

Igor Tandetnik 



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Recall: ODBC driver C source file includes a header which was not shipped

2008-04-25 Thread Abshagen, Martin RD-AS2
Hi,

I realize I have to recall my question. It was my fascination about the 
"amalgamation" version of sqlite3 that made me think that even sqlite3odbc.c  
was an "amalgamation". I apologize, should have read README before complaining.

Martin Abshagen

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Is it safe to ...

2008-04-25 Thread Alexander Batyrshin
On Mon, Mar 24, 2008 at 3:58 PM,  <[EMAIL PROTECTED]> wrote:
> "Alexander Batyrshin" <[EMAIL PROTECTED]> wrote:
>  > Hello,
>  > Is it safe to use this algorithm:
>  >
>  > open_db
>  > fork()
>  > sql_do() // both parent and child executes sql statements
>  > close_db
>  >
>  > I am not familiar with locking mechanism and I am afraid that if
>  > parent and child will use the same DB handlers it can cause of DB
>  > corruptions
>  >
>
>  It is not safe to carry an open SQLite database connection
>  across a fork.  The documentation says this somewhere, IIRC,
>  but I don't remember exactly where.  I should probably state
>  this fact in the documentation for sqlite3_open()...

I have new question. Is it save to close SQLite database at child
process or I should close it exactly before fork()?

-- 
Alexander Batyrshin aka bash
bash = Biomechanica Artificial Sabotage Humanoid
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] ODBC driver C source file includes a header which was notshipped

2008-04-25 Thread Christian Werner
"Abshagen, Martin RD-AS2" wrote:
> 
> Hi,
> 
> am trying to use the Sqlite3 ODBC driver for C, provided by Christian Werner 
> (http://www.ch-werner.de/sqliteodbc/, product sqliteodbc-0.77-1.src.rpm).
> If _WIN32 is defined, sqlite3odbc.c includes a  "resource3.h" header file, 
> which is not shipped with the version. How could I work around or find 
> "resource3.h"?

The resource3.h file is generated from resource.h.in,
see the Makefile.mingw-cross for the sed command line.
See also the mingw-cross-build.sh script on how the
drivers and SQLite are built.

HTH,
Christian
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Select by order Speed

2008-04-25 Thread Mahalakshmi.m

My table has records as follows:

Id  Track
1   zz
2   aaa
3   cc
4   aaa
5   aaa
6   aaa

1st 2 records -> SELECT Id, Track FROM MUSIC ORDER BY Track LIMIT 2;

Output: 2   aaa
4   aaa

Next 2->SELECT Id, Track FROM MUSIC WHERE Track > aaa ORDER BY Track LIMIT 2

Output: 3   cc
1   zz

But I want  5   aaa
6   aaa

Is there any other way for doing this or I have to use Limit, Offset only to
solve this.


For Previous 2:
SELECT Id, Track FROM MUSIC WHERE Track < aaa ORDER BY Track DESC LIMIT 2;

Thanks & Regards,
Mahalakshmi



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] ODBC driver C source file includes a header which was not shipped

2008-04-25 Thread Abshagen, Martin RD-AS2
Hi,

am trying to use the Sqlite3 ODBC driver for C, provided by Christian Werner 
(http://www.ch-werner.de/sqliteodbc/, product sqliteodbc-0.77-1.src.rpm).
If _WIN32 is defined, sqlite3odbc.c includes a  "resource3.h" header file, 
which is not shipped with the version. How could I work around or find 
"resource3.h"?

Best regards

Martin Abshagen
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users