Re: [sqlite] select %column% from table

2010-04-30 Thread David Lyon
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Sent: Fri, April 30, 2010 10:48:41 AM Subject: Re: [sqlite] select %column% from table crap! I completely misunderstood your question... be confused, and then ignore my reply. On Fri, Apr 30, 2010 at 9:43 AM, P Kishor <p

Re: [sqlite] select %column% from table

2010-04-30 Thread P Kishor
crap! I completely misunderstood your question... be confused, and then ignore my reply. On Fri, Apr 30, 2010 at 9:43 AM, P Kishor wrote: > On Fri, Apr 30, 2010 at 9:28 AM, David Lyon wrote: >> If I had a table called TABLE with fields P1N..P50N

Re: [sqlite] select %column% from table

2010-04-30 Thread Jay A. Kreibich
On Fri, Apr 30, 2010 at 07:28:52AM -0700, David Lyon scratched on the wall: > If I had a table called TABLE with fields P1N..P50N is there a way > to select something like: > > "select P%N from TABLE" SELECT * FROM... > to return all the results from columns P1N..P50N or do I have >

Re: [sqlite] select %column% from table

2010-04-30 Thread P Kishor
On Fri, Apr 30, 2010 at 9:28 AM, David Lyon wrote: > If I had a table called TABLE with fields P1N..P50N is there a way to > select something like: > > "select P%N from TABLE" > >  to return all the results from columns P1N..P50N or do I have to do it > manually:

Re: [sqlite] select %column% from table

2010-04-30 Thread Pavel Ivanov
You have to do it manually. Or reconsider your database schema towards normalization. Pavel On Fri, Apr 30, 2010 at 10:28 AM, David Lyon wrote: > If I had a table called TABLE with fields P1N..P50N is there a way to > select something like: > > "select P%N from

Re: [sqlite] Select * from tablename results in an exception

2010-03-31 Thread Burnett, Joe
: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Pavel Ivanov Sent: Wednesday, March 31, 2010 11:30 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Select * from tablename results in an exception > I had issues in my SQLite DB schema - VARCHAR

Re: [sqlite] Select * from tablename results in an exception

2010-03-31 Thread Pavel Ivanov
sqlite.org] On Behalf Of Tim Romano > Sent: Tuesday, March 30, 2010 5:20 PM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] Select * from tablename results in an exception > > http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvb/thread/27aec61 > 2-

Re: [sqlite] Select * from tablename results in an exception

2010-03-30 Thread Burnett, Joe
-Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Tim Romano Sent: Tuesday, March 30, 2010 5:20 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Select * from tablename results in an exception http

Re: [sqlite] Select * from tablename results in an exception

2010-03-30 Thread Tim Romano
http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvb/thread/27aec612-5ca4-41ba-80d6-0204893fdcd1 Maybe related. Regards Tim Romano ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Select * from tablename results in an exception

2010-03-30 Thread Simon Slavin
On 30 Mar 2010, at 2:55pm, Burnett, Joe wrote: > Your understanding is correct. However, I used the SQLite Admin tool and > the select * query > was successful after the table was populated and the program exited. > > Isn't that the same thing? Okay, if I understand your result, you have a

Re: [sqlite] Select * from tablename results in an exception

2010-03-30 Thread Burnett, Joe
: [sqlite] Select * from tablename results in an exception On 30 Mar 2010, at 2:01pm, Burnett, Joe wrote: > I am using SQLite in a C# .NET application. I am inserting into tables > without any issues as confirmed by the SQLite Admin tool. > However, later in the application, I want

Re: [sqlite] Select * from tablename results in an exception

2010-03-30 Thread Simon Slavin
On 30 Mar 2010, at 2:01pm, Burnett, Joe wrote: > I am using SQLite in a C# .NET application. I am inserting into tables > without any issues as confirmed by the SQLite Admin tool. > However, later in the application, I want to query the table where I > inserted the data, I get the following

Re: [sqlite] Select * from tablename results in an exception

2010-03-30 Thread Burnett, Joe
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: Tuesday, March 30, 2010 9:23 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Select * from tablename results in an exception On 30 Mar 2010, at 2:01pm, Burnett, Joe wrote: >string sql = &quo

Re: [sqlite] Select * from tablename results in an exception

2010-03-30 Thread Simon Slavin
On 30 Mar 2010, at 2:01pm, Burnett, Joe wrote: >string sql = "select * from Table"; Can you use 'Table' as the name of a table ? Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] SELECT from fts3 tokens, is it possible?

2009-12-28 Thread Scott Hess
On Mon, Dec 28, 2009 at 8:19 PM, Dan Kennedy wrote: >> If you want the data for other purposes, you could almost implement a >> hack to get is.  For instance, "SELECT count(docid) FROM fts_table >> WHERE fts_table MATCH 'x';" is kind of close, and you could change the >>

Re: [sqlite] SELECT from fts3 tokens, is it possible?

2009-12-28 Thread Dan Kennedy
> If you want the data for other purposes, you could almost implement a > hack to get is. For instance, "SELECT count(docid) FROM fts_table > WHERE fts_table MATCH 'x';" is kind of close, and you could change the > match to handle prefix stuff. Unfortunately, the fts vtable cursor > sets up a

Re: [sqlite] SELECT from fts3 tokens, is it possible?

2009-12-28 Thread Scott Hess
My comments around performance might be overly pedantic, I don't know. For the broad fts implementation, the cost of merging data from multiple segments is higher than one would like it to be, but the advantages gained are significant enough to make it overall worthwhile. One could implement a

Re: [sqlite] SELECT from fts3 tokens, is it possible?

2009-12-24 Thread Max Vlasov
Thanks, Scott, I see problems with regular tables, but to discuss in details I have to make some tests comparing the approaches. I read once again the info about fts3 internals and would like to share new thoughts. Let's forget about "hit count". Although I mentioned google suggestions, it was

Re: [sqlite] SELECT from fts3 tokens, is it possible?

2009-12-23 Thread Scott Hess
Doing this in the tokenizer is probably not great because you can't determine which of the tokens actually are in the database after accounting for deletes and updates. When I was last thinking about this problem, I think the best option looked like keeping a distinct token index with token_id

Re: [sqlite] SELECT from fts3 tokens, is it possible?

2009-12-23 Thread Max Vlasov
Scott, thank, I see that the hit counts is the next level of complexity. As for tokens, I think that if one really needs to implement this feature, there would be a possible solution in allowing the program to "mirror" tokenized" data. Right now as I see it would be possible (if a custom

Re: [sqlite] SELECT from fts3 tokens, is it possible?

2009-12-23 Thread Scott Hess
The tokens are all there, so it is "theoretically possible". But the performance would be very bad because it would require iterating over all the segment data, basically a worst-case query. Even then, you wouldn't have information about hit counts. To do it reasonably would require redesigning

Re: [sqlite] SELECT * vs SELECT columns ?

2009-10-29 Thread P Kishor
On Thu, Oct 29, 2009 at 3:19 PM, Gerry Snyder wrote: > Beau Wilkinson wrote: >> >>  If the schema changes, a listing of every column can be invalidated, but >> the asterisk cannot > > OTOH, a listing of every column may catch a query which is no longer > valid,

Re: [sqlite] SELECT * vs SELECT columns ?

2009-10-29 Thread P Kishor
On Thu, Oct 29, 2009 at 2:59 PM, John Crenshaw wrote: >> If the schema changes, a listing of every column can be >> invalidated, but the asterisk cannot. > > This is only partly true. At some point, the code is going to need to > grab the individual fields, and that is

Re: [sqlite] SELECT * vs SELECT columns ?

2009-10-29 Thread John Crenshaw
> If the schema changes, a listing of every column can be > invalidated, but the asterisk cannot. This is only partly true. At some point, the code is going to need to grab the individual fields, and that is the point where the asterisk fails to serve you well. If new fields are added to the

Re: [sqlite] SELECT * vs SELECT columns ?

2009-10-29 Thread Beau Wilkinson
On Behalf Of Kristoffer Danielsson Sent: Wednesday, October 28, 2009 12:51 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] SELECT * vs SELECT columns ? I don't know about SQLite, but in all SQL courses you learn that you should NEVER use the asterisk. The asterisk is merely there to le

Re: [sqlite] SELECT * vs SELECT columns ?

2009-10-28 Thread John Crenshaw
...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Kristoffer Danielsson Sent: Wednesday, October 28, 2009 12:51 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] SELECT * vs SELECT columns ? I don't know about SQLite, but in all SQL courses you learn that you should NEVER use

Re: [sqlite] SELECT * vs SELECT columns ?

2009-10-28 Thread Kristoffer Danielsson
I don't know about SQLite, but in all SQL courses you learn that you should NEVER use the asterisk. The asterisk is merely there to let you quickly view data _manually_. > Date: Wed, 28 Oct 2009 16:02:01 +0200 > From: mi...@limbasan.ro > To: sqlite-users@sqlite.org > Subject:

Re: [sqlite] SELECT * vs SELECT columns ?

2009-10-28 Thread Mihai Limbasan
I would expect there to be a speed and memory performance *impact* if the result set contains columns other than the three specified ones, since obviously the library will need to allocate more memory to hold the extra data. On 10/28/2009 03:52 PM, Pete56 wrote: > I am searching across two

Re: [sqlite] Select * from table where field = "value" does not work when "value" is also a field....

2009-10-14 Thread Simon Davies
2009/10/13 Hillebrand Snip : > I have a database with the following fields: > 1) Status (it will hold values like "Open", "Closed", "Submitted"... etc...) > 2) Closed (boolean field which contains 1 or 0) > > If i enter a query like:  Select * from Issues where Status !=

Re: [sqlite] SELECT ALL BUT syntax (was Re: less typing possible ?)

2009-09-28 Thread Stef Mientki
thanks Darren, Darren Duncan wrote: > Stef Mientki wrote: > >> hello, >> >> I often want to see most of the columns of a table / view / query, but a >> few I don't want to see. >> So I now create a huge list of fields, >> but isn't there a more typo-frindly way, like : >> >> select * -

Re: [sqlite] Select records by specific YEAR

2009-09-17 Thread P Kishor
On Wed, Sep 16, 2009 at 9:16 AM, SHARMAQ Sistemas wrote: > Hi, > > > > I have a table called PEOPLE with 2 fiels: > > > > NAME --> TEXT 40 > > BIRTH --> DATETIME > > > > With some records > > > > I want to filter all people with BIRTH = 1946, I'm trying this: > > > > SELECT

Re: [sqlite] Select records by specific YEAR

2009-09-16 Thread Simon Slavin
On 16 Sep 2009, at 6:05pm, vbshar wrote: > I think the problem is in field format ou data format, because if i > insert > data from my app SQLite does not return any value, but if i insert > data with > the manager "SQLite developer"; the query works... Your definition >> BIRTH à DATETIME

Re: [sqlite] Select records by specific YEAR

2009-09-16 Thread Pavel Ivanov
Maybe. Also there's a question when I wanted to ask in the first letter too: where did you get function year() from? I don't see it in http://www.sqlite.org/lang_datefunc.html and my sqlite3 doesn't see it too: sqlite> select year(date('now')); SQL error: no such function: year Maybe it's SQLite

Re: [sqlite] Select records by specific YEAR

2009-09-16 Thread vbshar
I think the problem is in field format ou data format, because if i insert data from my app SQLite does not return any value, but if i insert data with the manager "SQLite developer"; the query works... Pavel Ivanov-2 wrote: > > Did you try to put 1946 without quotes? > > Pavel > > On Wed,

Re: [sqlite] Select records by specific YEAR

2009-09-16 Thread Pavel Ivanov
Did you try to put 1946 without quotes? Pavel On Wed, Sep 16, 2009 at 12:21 PM, vbshar wrote: > > Hi, > > I have a table called PEOPLE with 2 fiels: > > NAME à TEXT 40 > BIRTH à DATETIME > > With some records > > I want to filter all people with BIRTH = 1946, I’m trying

Re: [sqlite] SELECT * from ?

2009-08-12 Thread David Bicking
On Thu, 2009-08-13 at 01:12 +0100, Simon Slavin wrote: > On 12 Aug 2009, at 11:35pm, Igor Tandetnik wrote: > > > Bill Welbourn > > wrote: > >> I am new to the forum and have a question regarding querying data > >> from a table, where the table name is random. For example,

Re: [sqlite] SELECT * from ?

2009-08-12 Thread Simon Slavin
On 12 Aug 2009, at 11:35pm, Igor Tandetnik wrote: > Bill Welbourn > wrote: >> I am new to the forum and have a question regarding querying data >> from a table, where the table name is random. For example, I have a >> database possessing upwards of 41 tables named, TAB10,

Re: [sqlite] SELECT * from ?

2009-08-12 Thread Igor Tandetnik
Bill Welbourn wrote: > I am new to the forum and have a question regarding querying data > from a table, where the table name is random. For example, I have a > database possessing upwards of 41 tables named, TAB10, TAB11,..., > TAB50, and would like to query each table.

Re: [sqlite] SELECT DISTINCT bug in SQLite 3.6.0?

2009-07-31 Thread Lennart Ramberg
... or might it even be so, that good praxis is when using field names, to always use the AS clause, even if no table-alias are used? Like: rs=db.SQLSelect("SELECT x AS x FROM t") zstring=rs.Field("x").StringValue Lennart Ramberg On Fri, Jul 31, 2009 at 3:12 PM, Lennart

Re: [sqlite] SELECT DISTINCT bug in SQLite 3.6.0?

2009-07-31 Thread Lennart Ramberg
Thanks for quick responses, Actually, removing DISTINCT removes the problem, but anyway, as I understand, I should always use the AS clause when using alias to be on the safe side, right? Lennart Ramberg On Fri, Jul 31, 2009 at 2:40 PM, Igor Tandetnik wrote: > Lennart

Re: [sqlite] SELECT DISTINCT bug in SQLite 3.6.0?

2009-07-31 Thread Igor Tandetnik
Lennart Ramberg wrote: > dim rs as RecordSet > rs=dbEta.SQLSelect("SELECT DISTINCT V.resanr,C.namn"_ > +" FROM Voyages V,Category C WHERE C.kategorinr=V.kategorinr") > > dim namnstr as string > > namnstr=rs.Field("namn").StringValue 'I get a NilObjectException > here in 3.6.0 ... >

Re: [sqlite] SELECT DISTINCT bug in SQLite 3.6.0?

2009-07-31 Thread Mike Eggleston
On Fri, 31 Jul 2009, Lennart Ramberg might have said: > Hello, > > I'm new to this list and what prompted me to sign up was a SELECT > DISTINCT problem I experience in REALbasic (Linux), which has SQLite > built-in. > > REALbasic downgraded their latest version from SQLIte 3.6.3 to 3.6.0 > Now,

Re: [sqlite] Select on foreign key NULL

2009-05-26 Thread Leo Freitag
Thanks a lot. Both works fine. Leo John Machin schrieb: > On 27/05/2009 1:09 AM, Leo Freitag wrote: > >> Hallo, >> >> I got some problems with a select on a foreign key with value null. >> I want to filter all male singers. >> >> CREATE TABLE 'tblsinger' ('id' INTEGER PRIMARY KEY, 'name' TEXT,

Re: [sqlite] Select on foreign key NULL

2009-05-26 Thread John Machin
On 27/05/2009 1:09 AM, Leo Freitag wrote: > Hallo, > > I got some problems with a select on a foreign key with value null. > I want to filter all male singers. > > CREATE TABLE 'tblsinger' ('id' INTEGER PRIMARY KEY, 'name' TEXT, > 'fkvoice' INTEGER, 'sex' TEXT); > INSERT INTO "tblsinger"

Re: [sqlite] Select on foreign key NULL

2009-05-26 Thread Simon Davies
2009/5/26 Leo Freitag : > Hallo, > > I got some problems with a select on a foreign key with value null. > I want to filter all male singers. > > CREATE TABLE 'tblsinger' ('id' INTEGER PRIMARY KEY, 'name' TEXT, > 'fkvoice' INTEGER, 'sex' TEXT); > INSERT INTO "tblsinger"

Re: [sqlite] select performance with join

2009-05-09 Thread Jim Wilcoxson
Thanks for the explanation. I recall seeing posts suggesting the use of union instead of or, and thought "if it's that easy, why doesn't SQLite do it?" The optimizer documentation says: --- Suppose the OR clause consists of multiple subterms as follows: expr1 OR expr2 OR expr3 If every

Re: [sqlite] select performance with join

2009-05-08 Thread Igor Tandetnik
wrote in message news:20090508113252.2uqkghcsj6og8...@webmail.korg.it > Citando Igor Tandetnik : > >> Andrea Galeazzi wrote: >>> but when I execute: >>> >>> SELECT S.id,title,artist,bpm,name >>> >>> FROM Song AS S >>> >>> LEFT JOIN Genre

Re: [sqlite] select performance with join

2009-05-08 Thread Igor Tandetnik
"Jim Wilcoxson" wrote in message news:c5830b750905080813p6bf901bn526c81ca8ce7a...@mail.gmail.com > I don't know if it makes any difference, but is that where clause the > same as: > > WHERE name< 'zUmM' OR (name= 'zUmM' AND S.id< 8122) SQLite's optimizer cannot use an index for

Re: [sqlite] select performance with join

2009-05-08 Thread Jim Wilcoxson
I don't know if it makes any difference, but is that where clause the same as: WHERE name< 'zUmM' OR (name= 'zUmM' AND S.id< 8122) The original way it was coded, all 3 conditions would have to be evaluated most of the time. The new way might get most rows with 1 condition. Depends on the data

Re: [sqlite] select performance with join

2009-05-08 Thread galeazzi
Citando Igor Tandetnik : > Andrea Galeazzi wrote: >> but when I execute: >> >> SELECT S.id,title,artist,bpm,name >> >> FROM Song AS S >> >> LEFT JOIN Genre AS G ON (S.genre_id = G.id) >> >> WHERE name<= 'zUmM' AND (name< 'zUmM' OR S.id< 8122) >> >> ORDER BY

Re: [sqlite] select performance with join

2009-05-07 Thread Igor Tandetnik
Andrea Galeazzi wrote: > but when I execute: > > SELECT S.id,title,artist,bpm,name > > FROM Song AS S > > LEFT JOIN Genre AS G ON (S.genre_id = G.id) > > WHERE name<= 'zUmM' AND (name< 'zUmM' OR S.id< 8122) > > ORDER BY name DESC, S.id DESC LIMIT 20; Note that LEFT JOIN is

Re: [sqlite] Select statements in the context of transactions.

2009-04-07 Thread Rosemary Alles
Thanks Puneet. Those suggestions really help. -rosemary. On Apr 7, 2009, at 5:52 PM, P Kishor wrote: > On Tue, Apr 7, 2009 at 5:18 PM, Rosemary Alles > wrote: >> Puneet, >> >> As you suggested I have supplied a brief background re: the problem: >> >> Background: >>

Re: [sqlite] Select statements in the context of transactions.

2009-04-07 Thread P Kishor
On Tue, Apr 7, 2009 at 5:18 PM, Rosemary Alles wrote: > Puneet, > > As you suggested I have supplied a brief background re: the problem: > > Background: > I'm very new to sql (x2 weeks). I have a database with two tables one > with -say (max)- 12k rows of data, and the

Re: [sqlite] Select statements in the context of transactions.

2009-04-07 Thread John Stanton
A TRANSACTION only has a meaning when the database is being altered. There are no journalling and commits on a read. You get the results of the SELECT as soon as the database read occurs. You cannot be faster than that. Where you can get improved SELECT performance is by using caching.

Re: [sqlite] Select statements in the context of transactions.

2009-04-07 Thread Rosemary Alles
Puneet, As you suggested I have supplied a brief background re: the problem: Background: I'm very new to sql (x2 weeks). I have a database with two tables one with -say (max)- 12k rows of data, and the other with more. The first table (lets calls it A) has the following columns: source_id,

Re: [sqlite] Select statements in the context of transactions.

2009-04-07 Thread P Kishor
On Tue, Apr 7, 2009 at 3:45 PM, Rosemary Alles wrote: > Hullo Puneet, > > Many thanks for your response. > > My understanding of a sqlite3 "transaction" is probably poor. From your > response > (if you are correct) I see that only UPDATES and INSERTS can be speeded up >

Re: [sqlite] Select statements in the context of transactions.

2009-04-07 Thread Igor Tandetnik
Rosemary Alles wrote: > Is there no difference in behavior between a SINGLE select and several > of them within the context of transaction? There is, of course, a difference between running one SELECT statement and running more than one, regardless of transactions. I

Re: [sqlite] Select statements in the context of transactions.

2009-04-07 Thread Rosemary Alles
Hullo Puneet, Many thanks for your response. My understanding of a sqlite3 "transaction" is probably poor. From your response (if you are correct) I see that only UPDATES and INSERTS can be speeded up via bundling many numbers of them in a Being/Commit block? Leading me to ask: Is there no

Re: [sqlite] Select statements in the context of transactions.

2009-04-07 Thread Igor Tandetnik
Rosemary Alles wrote: > 1) If I were to bundle several thousand SELECT statements in a single > transaction - why would it not run faster? Why do you believe it should? > 2) This is precisely the problem though - each of those statements > will yield rows of results to

Re: [sqlite] Select statements in the context of transactions.

2009-04-07 Thread P Kishor
On Tue, Apr 7, 2009 at 2:36 PM, Rosemary Alles wrote: > Hullo Igor, > > Many thanks for your response: I believe I didn't phrase my question > correctly: > > 1) If I were to bundle several thousand SELECT statements in a single > transaction - why would it not run faster?

Re: [sqlite] Select statements in the context of transactions.

2009-04-07 Thread Rosemary Alles
Hullo Igor, Many thanks for your response: I believe I didn't phrase my question correctly: 1) If I were to bundle several thousand SELECT statements in a single transaction - why would it not run faster? 2) This is precisely the problem though - each of those statements will yield rows of

Re: [sqlite] Select statements in the context of transactions.

2009-04-06 Thread Igor Tandetnik
"Rosemary Alles" wrote in message news:20a6b796-613b-4f5d-bfca-359d6b9fa...@ipac.caltech.edu > I want to speed up my app. Can I run SELECT statements within the > context of a transaction. Yes, but it's unlikely to make it run any faster. > If so, how does one handle the

Re: [sqlite] select with a like containing a line feed

2009-04-03 Thread Sylvain Pointeau
it is really perfect,thank you so much On Fri, Apr 3, 2009 at 2:55 PM, Simon Davies < simon.james.dav...@googlemail.com> wrote: > 2009/4/3 Sylvain Pointeau : > > re-hi, > > but how do we do if we are on unix and there is some CR on those field? > > I cannot insert CR

Re: [sqlite] select with a like containing a line feed

2009-04-03 Thread Simon Davies
2009/4/3 Sylvain Pointeau : > re-hi, > but how do we do if we are on unix and there is some CR on those field? > I cannot insert CR in my statement (only line feed) > > do you have any suggestion? > > Cheers, > Sylvain > Something like this: SQLite version 3.4.2 Enter

Re: [sqlite] select with a like containing a line feed

2009-04-03 Thread Sylvain Pointeau
re-hi, but how do we do if we are on unix and there is some CR on those field? I cannot insert CR in my statement (only line feed) do you have any suggestion? Cheers, Sylvain On Fri, Apr 3, 2009 at 2:15 PM, Sylvain Pointeau wrote: > Hi, > thank you very much for

Re: [sqlite] select with a like containing a line feed

2009-04-03 Thread Emil Obermayr
On Fri, Apr 03, 2009 at 12:25:18PM +0200, Sylvain Pointeau wrote: > > How do I specify the character "line feed" (\n) > in my query? Depends a little on your wrapper (outer) programming language. A technic that works in most language is to fill a variable with the code of LF and then use this

Re: [sqlite] select with a like containing a line feed

2009-04-03 Thread Igor Tandetnik
"Sylvain Pointeau" wrote in message news:af5c8a920904030325w631f8dfcu90f5f80266f57...@mail.gmail.com > I have some line feed in one field in my table > and I would like to replace this line feed by a space. > > How do I specify the character "line feed" (\n) > in my

Re: [sqlite] select the first 2 rows

2009-04-02 Thread Shane Harrelson
Remember, the order of rows returned from a SELECT, even one with a LIMIT clause, is undefined, so the "first 2 rows" may not be consistently the same. If you are dependent upon the rows being returned in a particular order (say by "rowid"), you should include an ORDER BY clause on your SELECT

Re: [sqlite] select the first 2 rows

2009-04-01 Thread Joanne Pham
Thanks Eric. Joanne   From: Eric Minbiole <eminbi...@mavroimaging.com> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Sent: Wednesday, April 1, 2009 12:02:18 PM Subject: Re: [sqlite] select the first 2 rows > Hi all, >

Re: [sqlite] select by min di

2009-03-29 Thread Igor Tandetnik
"baxy77bax" wrote in message news:22767988.p...@talk.nabble.com > hi , > i need help with this one : i have a table with 2 columns C1 & C2: > > C1 C2 > > a 1 > b 1 > b 2 > b 4 > c 3 > v 2 > c 5 > d 5 > > and i need to get this: > > C1 C2 > > a 1 > b 1 > c 3 > d 5

Re: [sqlite] Select table name and count(*) on same command

2009-03-26 Thread P Kishor
On Thu, Mar 26, 2009 at 3:18 PM, REPKA_Maxime_NeufBox wrote: > Hello, > > Exemple of 2 SQL command : > sqlite> select name from sqlite_master where type='table'; >    City >    Country >    CountryLanguage >    sqlite_stat1 > > sqlite> select count(*) from country; >    239

Re: [sqlite] Select table name and count(*) on same command

2009-03-26 Thread Igor Tandetnik
REPKA_Maxime_NeufBox wrote: > Exemple of 2 SQL command : > sqlite> select name from sqlite_master where type='table'; >City >Country >CountryLanguage >sqlite_stat1 > > sqlite> select count(*) from country; >239 > > ->> Could anyone tell me what is the

Re: [sqlite] SELECT queries and NULL value parameters

2009-03-11 Thread Sylvain Pointeau
you can also use ifnull(myvar1,'') = ifnull(myvar2,'') or something in the same way. I used it for avoiding creating 2 queries for each cases. Cheers, Sylvain On Wed, Mar 11, 2009 at 4:14 PM, Jim Wilcoxson wrote: > I used the Solid database for many years, since they came

Re: [sqlite] SELECT queries and NULL value parameters

2009-03-11 Thread Hynes, Tom
like I've had a misconception about this. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of P Kishor Sent: Wednesday, March 11, 2009 10:25 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] SELECT queries

Re: [sqlite] SELECT queries and NULL value parameters

2009-03-11 Thread P Kishor
oun...@sqlite.org] On Behalf Of Martin Engelschalk > Sent: Wednesday, March 11, 2009 8:59 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] SELECT queries and NULL value parameters > > Hi, > > yes, this is expected. Note that you use the = - operat

Re: [sqlite] SELECT queries and NULL value parameters

2009-03-11 Thread Hynes, Tom
AM To: General Discussion of SQLite Database Subject: Re: [sqlite] SELECT queries and NULL value parameters Hi, yes, this is expected. Note that you use the = - operator in WHERE maybenullcolumn = @value and NULL = NULL evaluates to false. This is SQL standard. Martin diego.d...@bentley.com wr

Re: [sqlite] select statement - Need help

2009-03-08 Thread Igor Tandetnik
"Joanne Pham" wrote in message news:936179.87380...@web90307.mail.mud.yahoo.com > I have the folowing table which has the following data for example: > remoteId hostName lastUpdateTime > > So if I ran this statement below: > select * from table group by hostName having

Re: [sqlite] select statement - Need help

2009-03-08 Thread Joanne Pham
2009 1:44:01 PM Subject: Re: [sqlite] select statement - Need help It gave me the syntax error! JP From: "Adler, Eliedaat" <ead...@nds.com> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Sent: Sunday, March 8, 2009 1:

Re: [sqlite] select statement - Need help

2009-03-08 Thread Joanne Pham
It gave me the syntax error! JP From: "Adler, Eliedaat" <ead...@nds.com> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Sent: Sunday, March 8, 2009 1:08:51 PM Subject: Re: [sqlite] select statement - Need help By sid

Re: [sqlite] select statement - Need help

2009-03-08 Thread Adler, Eliedaat
By side-effect the following statement should give those values: Select remoteId, hostName, max(lastUpdateTime) from (select * from table order by hostName, lastUpdateTime) Group by hostName having count(*) > 1 ; The outer select will return the last row processed by

Re: [sqlite] SELECT issue with SQLite 3.6.10

2009-01-28 Thread KurDtE
You got it right Igor ! So I have my table GENERAL with a field ID. I create a view VIEW_GENERAL like this : CREATE VIEW VIEW_GENERAL AS SELECT GENERAL.ID FROM GENERAL Note that this is just an example, in my real case, I needed to select GENERAL.ID instead of ID only because I also do some

Re: [sqlite] SELECT issue with SQLite 3.6.10

2009-01-27 Thread Igor Tandetnik
KurDtE wrote: > I'm getting pretty confused : > When I execute the query SELECT "GENERAL.ID" FROM VIEW_GENERAL; on > SQLite Administrator (which uses an older version of SQLite than > 3.6.10), everything works fine, but when I try the same query with > SQLite 3.6.10 on command

Re: [sqlite] SELECT issue with SQLite 3.6.10

2009-01-27 Thread Noah Hart
Please supply the SQL TEXT for the TABLE and the VIEW; Noah -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of KurDtE Sent: Tuesday, January 27, 2009 8:41 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] SELECT issue

Re: [sqlite] SELECT issue with SQLite 3.6.10

2009-01-27 Thread KurDtE
First, thank you both for your help ! I'm getting pretty confused : When I execute the query SELECT "GENERAL.ID" FROM VIEW_GENERAL; on SQLite Administrator (which uses an older version of SQLite than 3.6.10), everything works fine, but when I try the same query with SQLite 3.6.10 on command

Re: [sqlite] SELECT issue with SQLite 3.6.10

2009-01-27 Thread Fred Williams
Subject: Re: [sqlite] SELECT issue with SQLite 3.6.10 On Jan 27, 2009, at 10:08 AM, Fred Williams wrote: > > Should not the GENERAL.ID be enclosed in double quotes? Or did I > misread > the SQL Standard? You can use double-quotes to conform to the SQL standard. But SQLite also all

Re: [sqlite] SELECT issue with SQLite 3.6.10

2009-01-27 Thread D. Richard Hipp
On Jan 27, 2009, at 10:08 AM, Fred Williams wrote: > > Should not the GENERAL.ID be enclosed in double quotes? Or did I > misread > the SQL Standard? You can use double-quotes to conform to the SQL standard. But SQLite also allows some non-standard quoting mechanisms for compatibility

Re: [sqlite] SELECT issue with SQLite 3.6.10

2009-01-27 Thread Fred Williams
of SQLite Database Subject: Re: [sqlite] SELECT issue with SQLite 3.6.10 On Jan 27, 2009, at 5:24 AM, KurDtE wrote: > > Dear all, > > Yesterday I upgraded my SQLite version from version 3.5.9 to 3.6.10, > and I > now experience an issue while making a SELECT on one of my vie

Re: [sqlite] SELECT issue with SQLite 3.6.10

2009-01-27 Thread D. Richard Hipp
On Jan 27, 2009, at 5:24 AM, KurDtE wrote: > > Dear all, > > Yesterday I upgraded my SQLite version from version 3.5.9 to 3.6.10, > and I > now experience an issue while making a SELECT on one of my view : > > This query was previously working on version 3.5.9 : > SELECT [GENERAL.ID] FROM

Re: [sqlite] Select Limit issues

2008-11-30 Thread Igor Tandetnik
"Webmaster" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ok, Did that but now it doesn't run? > > select * from ( >select * from table1 where Field2='Red' order by Field1 limit 1 > offset :X) I meant that you would put an actual number in place of :X. Or else, that you would

Re: [sqlite] Select Limit issues

2008-11-30 Thread P Kishor
---Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Igor Tandetnik > > Sent: Sunday, November 30, 2008 9:15 PM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Select Limit issues > > > "Webmaster" <[EMAIL P

Re: [sqlite] Select Limit issues

2008-11-30 Thread Webmaster
er by Field1 limit 1 ) order by Field1; I take it I am missing something here? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Igor Tandetnik Sent: Sunday, November 30, 2008 9:15 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Select Limit issues

Re: [sqlite] Select Limit issues

2008-11-30 Thread Igor Tandetnik
"Webmaster" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Looping. > > Is there a way to put this into a loop where it starts again but with > the > next Field2 ='Red' Replace all subqueries that look like this: (select Field1 from table1 where Field2='Red' order by Field1 limit

Re: [sqlite] Select Limit issues

2008-11-30 Thread Webmaster
: [sqlite] Select Limit issues "Webmaster" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Now I am getting the following error: > SQL Error: ORDER BY clause should come after UNION ALL not before Right, you need another level of indirection: select * from ( sele

Re: [sqlite] Select Limit issues

2008-11-30 Thread Webmaster
vember 30, 2008 2:20 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Select Limit issues "Webmaster" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Now I am getting the following error: > SQL Error: ORDER BY clause should come after UNION ALL not before

Re: [sqlite] Select Limit issues

2008-11-30 Thread Alexey Pechnikov
Hello! В сообщении от Sunday 30 November 2008 23:19:52 Igor Tandetnik написал(а): > Personally, I'd implement logic like this in my application code, rather > than in ever-more-complex SQL statements. May be as create temp table A; insert into A     select * from table1 where Field2='Red'

Re: [sqlite] Select Limit issues

2008-11-30 Thread Igor Tandetnik
"Webmaster" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Now I am getting the following error: > SQL Error: ORDER BY clause should come after UNION ALL not before Right, you need another level of indirection: select * from ( select * from table1 where Field2='Red' order by

Re: [sqlite] Select Limit issues

2008-11-30 Thread Webmaster
Subject: Re: [sqlite] Select Limit issues "Webmaster" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I am trying query for this. > Find a first occurrence of "Red" > Then find searching from this record find the previous 4 records that > co

Re: [sqlite] Select Limit issues

2008-11-30 Thread Igor Tandetnik
"Webmaster" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I am trying query for this. > Find a first occurrence of "Red" > Then find searching from this record find the previous 4 records that > contain "White" Then find the Previous 1 that contains "Blue" > Now do the same thing

Re: [sqlite] Select Limit issues

2008-11-30 Thread Webmaster
58,White,12:00 381.01,White,12:00 417.44,White,12:00 854.60,Blue,12:00 I was thinking more like a "Rats Nest" :-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of P Kishor Sent: Saturday, November 29, 2008 7:24 PM To: General Discussion of

Re: [sqlite] Select Limit issues

2008-11-29 Thread Igor Tandetnik
"Webmaster" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > select field1, field2 from > ( select * from ee_table1 > where field2 = 'blue' limit 1 > and field1 < (select min(field1) from (select * from ee_table1 > where field2 = 'white'

<    1   2   3   4   5   6   7   8   >