Re: [sqlite] Need help with SQL query

2017-09-22 Thread Kees Nuyt
On Fri, 22 Sep 2017 10:54:21 +0100, John G wrote: >I know this is an older thread, but shouldn't that reference be on the ITEM >table ? So ... > >CREATE TABLE ATTRIBUTES ( >ITEM_ID INTEGER REFERENCES ITEM(ID) ON DELETE CASCADE, > KEY TEXT, >VALUE TEXT, >

Re: [sqlite] Need help with SQL query

2017-09-22 Thread John G
I know this is an older thread, but shouldn't that reference be on the ITEM table ? So ... CREATE TABLE ATTRIBUTES ( ITEM_ID INTEGER REFERENCES ITEM(ID) ON DELETE CASCADE, KEY TEXT, VALUE TEXT, PRIMARY KEY (ITEM_ID,KEY) ) WITHOUT ROWID; John G On 11 September 2017 at 13:11,

Re: [sqlite] Need help with SQL query

2017-09-11 Thread Kees Nuyt
On Mon, 11 Sep 2017 14:05:25 +0200, Kees Nuyt wrote: > CREATE TABLE ATTRIBUTES ( > ITEM_ID INTEGER REFERENCES ATTRIBUTES(ID) ON DELETE CASCADE, > KEY TEXT, > VALUE TEXT, > PRIMARY KEY (ITEM_ID,KEY) > ) WITHOUT ROWID; > CREATE INDEX attr_item_id ON ATTRIBUTES(ITEM_ID);

Re: [sqlite] Need help with SQL query

2017-09-11 Thread Kees Nuyt
On Sun, 10 Sep 2017 20:35:16 -0700, Vikas Aditya wrote: > Hi All, > > I need some help in figuring our right query syntax for querying > items from two tables. We have two tables. One of the table has > list of items. And Second table has additional attributes. Adding

Re: [sqlite] Need help with SQL query

2017-09-10 Thread R Smith
Correction: On 2017/09/11 6:43 AM, R Smith wrote: SELECT I.ID, ISNULL(A.VALUE,'[No Value]')   FROM ITEM AS I   LEFT JOIN ATTRIBUTES AS A ON A.ITEM_ID = I.ID  WHERE A.key='abc' OR A.key IS NULL  ORDER BY A.VALUE; There is of course no such thing as SORT BY in SQL, it's ORDER BY. (Forgive me,

Re: [sqlite] Need help with SQL query

2017-09-10 Thread R Smith
On 2017/09/11 5:35 AM, Vikas Aditya wrote: Hi All, I need some help in figuring our right query syntax for querying items from two tables. We have two tables. One of the table has list of items. And Second table has additional attributes. CREATE TABLE ITEM ( ID INTEGER, FIELD0 TEXT FIELD1

[sqlite] Need help with SQL query

2017-09-10 Thread Vikas Aditya
Hi All, I need some help in figuring our right query syntax for querying items from two tables. We have two tables. One of the table has list of items. And Second table has additional attributes. CREATE TABLE ITEM ( ID INTEGER, FIELD0 TEXT FIELD1 TEXT, FIELD3 TEXT, FIELD4 TEXT ); CREATE TABLE

Re: [sqlite] need help to implement a VTAB on a already sorted table

2017-05-10 Thread petern
Richard. Further to your reply on Mar 31 2017, were those newly worked code exemplars demonstrating non-trivial sqlite3_index_info from xBestIndex interaction for a SQLite table backed vtable published? I am sure there is still great interest for this information considering the lack of even one

Re: [sqlite] need help to implement a VTAB on a already sorted table

2017-03-31 Thread jose isaias cabrera
Some examples of these would be great, Dr. Hipp. Thanks. On 2017-03-31 09:06, Richard Hipp wrote: > On 3/31/17, aotto wrote: > >> I already have a working implementation with [a] close [to] empty >> *xBestIndex and *xFilter. >> >> 6) I expect for a primitive WHERE

Re: [sqlite] need help to implement a VTAB on a already sorted table

2017-03-31 Thread Richard Hipp
On 3/31/17, aotto wrote: > I already have a working implementation with [a] close [to] empty > *xBestIndex and *xFilter. > > 6) I expect for a primitive WHERE clause like "rep=XXX" some kind of access >optimization… Your xBestIndex and xFilter functions must implement

[sqlite] need help to implement a VTAB on a already sorted table

2017-03-31 Thread aotto
Hi… I'm new to this mailing-list because I have a problem to define a "VIRTUAL TABLE" sqlite3 extension. I already have a working implementation with close empty *xBestIndex and *xFilter. 1) My data is already in a sorted list with ONE or MORE primary index columns 2) Currently the VTAB is

Re: [sqlite] Need help with System.Data.SQLite

2017-01-11 Thread Burtsev , Dmitriy
mn." -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Hick Gunter Sent: Wednesday, January 11, 2017 11:29 AM To: 'SQLite mailing list' Subject: Re: [sqlite] Need help with System.Data.SQLite What is the result if you exchange

Re: [sqlite] Need help with System.Data.SQLite

2017-01-11 Thread Hick Gunter
ts.sqlite.org] Im Auftrag von Burtsev, Dmitriy Gesendet: Mittwoch, 11. Jänner 2017 15:48 An: 'SQLite mailing list' <sqlite-users@mailinglists.sqlite.org> Betreff: Re: [sqlite] Need help with System.Data.SQLite I didn't assign any value directly. This is what I did: 1. On SQLite creat

Re: [sqlite] Need help with System.Data.SQLite

2017-01-11 Thread Burtsev , Dmitriy
e-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of GB Sent: Wednesday, January 11, 2017 2:25 AM To: SQLite mailing list Subject: Re: [sqlite] Need help with System.Data.SQLite SQLite does not really care about precision and scale. See https://sqlite.org/datatype3.html f

Re: [sqlite] Need help with System.Data.SQLite

2017-01-10 Thread GB
017 2:08 AM To: SQLite mailing list Subject: Re: [sqlite] Need help with System.Data.SQLite System.Data.SqlTypes.SqlDecimal is specific to the SQL Server provider and thus the SQLite provider doesn't know how to handle it. Try using System.Decimal as a more generic approach. If you need to be

Re: [sqlite] Need help with System.Data.SQLite

2017-01-10 Thread Burtsev , Dmitriy
On Behalf Of GB Sent: Tuesday, January 10, 2017 2:08 AM To: SQLite mailing list Subject: Re: [sqlite] Need help with System.Data.SQLite System.Data.SqlTypes.SqlDecimal is specific to the SQL Server provider and thus the SQLite provider doesn't know how to handle it. Try using System.Decimal as a

Re: [sqlite] Need help with System.Data.SQLite

2017-01-09 Thread GB
System.Data.SqlTypes.SqlDecimal is specific to the SQL Server provider and thus the SQLite provider doesn't know how to handle it. Try using System.Decimal as a more generic approach. If you need to be portable across providers, you will be better off using classes from System.Data.Common

Re: [sqlite] Need help with System.Data.SQLite

2017-01-09 Thread Drago, William @ CSG - NARDA-MITEQ
> -Original Message- > From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On > Behalf Of Burtsev, Dmitriy > Sent: Monday, January 09, 2017 10:10 AM > To: 'SQLite mailing list' <sqlite-users@mailinglists.sqlite.org> > Subject: [sqlite] Need help

[sqlite] Need help with System.Data.SQLite

2017-01-09 Thread Burtsev , Dmitriy
Is this a right mail group for System.Data.SQLite ? -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Burtsev, Dmitriy Sent: Thursday, January 05, 2017 9:08 AM To: 'sqlite-users@mailinglists.sqlite.org' Subject: [sqlite] Need help

[sqlite] Need help with System.Data.SQLite.SQLiteDataReader and NUMERIC(5, 5) column

2017-01-05 Thread Burtsev , Dmitriy
Hello I got this error: Exception calling "WriteToServer" with "1" argument(s): "The given value of type SqlDecimal from the data source cannot be converted to type decimal of the specified target column." How to reproduce. 1. On SQLite execute this statements. CREATE TABLE FromNum ( id

Re: [sqlite] Need help on SQLite In-Memory Mode

2014-08-11 Thread Kevin Benson
On Mon, Aug 11, 2014 at 9:19 PM, Nick Bao wrote: > Thanks, Joe! > > But it did not work for me. > > Still got the error: > System.ArgumentException: Invalid ConnectionString format for parameter > "FullUri" > > > Are you using System.Data.SQLite version > *1.0.81.0 ?*

Re: [sqlite] Need help on SQLite In-Memory Mode

2014-08-11 Thread Nick Bao
n Facebook, Twitter and LinkedIn!   -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Joe Mistachkin Sent: Saturday, August 09, 2014 9:54 AM To: 'General Discussion of SQLite Database' Subject: Re: [sqlite] Need help on SQLite

Re: [sqlite] Need help on SQLite In-Memory Mode

2014-08-08 Thread Joe Mistachkin
Try this: SQLiteConnection connection = new SQLiteConnection( "FullUri=file::memory:?cache=shared;"); -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] Need help on SQLite In-Memory Mode

2014-08-08 Thread №⑥ 沨
‍‍ Hi dear sqlite users, I am using SQLite In-Memory Database in my application. My application is written in C#. I am trying to create an In-Memory Database that can be opened by multiple connections as descripted in this link. What it is the right format of connection string in this

[sqlite] Need Help

2013-04-16 Thread Vijay Mekala
Hi, I am new to sqlite and my objective is to run the sqlite tests on build where sqlite got integrated and have to use my own ZFS for my test. I have downloaded the source where tests are available but need help on how to take them and run against sqlite which is integrated in our code. Can

Re: [sqlite] Need help with query

2013-01-15 Thread Michael Black
SQLite Database Subject: [sqlite] Need help with query Hi all, given CREATE TABLE masterlanguages ( ID integer primary key autoincrement, Key1varchar not null, Key2varchar not null, ISOCode varchar not null, Description varchar not null, MaxCharsinteger d

Re: [sqlite] Need help with query

2013-01-14 Thread Kai Peters
On Tue, 15 Jan 2013 14:57:42 +0900, Yongil Jang wrote: > SELECT t1.key1, t1.key2, t2.description FROM MASTERLANGUAGES as t1, > MASTERLANGUAGES as t2 WHERE > t1.ISOCode = 'DEU' and t2.ISOCode = 'ENG' and t1.key1 = t2.key1 and t1.key2 = > t2.key2; that is very close - just needed to add

Re: [sqlite] Need help with query

2013-01-14 Thread Yongil Jang
like this? sqlite> SELECT t1.key1, t1.key2, t2.description FROM MASTERLANGUAGES as t1, MASTERLANGUAGES as t2 WHERE t1.ISOCode = 'DEU' and t2.ISOCode = 'ENG' and t1.key1 = t2.key1 and t1.key2 = t2.key2; FORM1|SAVE_BUTTON|Save FORM1|HELP_BUTTON|Help Sorry if my try is wrong. 2013/1/15 Kai Peters

[sqlite] Need help with query

2013-01-14 Thread Kai Peters
Hi all, given CREATE TABLE masterlanguages ( ID integer primary key autoincrement, Key1varchar not null, Key2varchar not null, ISOCode varchar not null, Description varchar not null, MaxCharsinteger default 0 ); insert into masterlanguages values

[sqlite] Need help with adding Update Callback for node-sqlite

2012-01-16 Thread Ashwini Jadhav
I am not sure if this is the correct mailing list to ask this question. If not, please redirect me to the correct forum. I am using Node js with node-sqlite extension. I tried to use the commented out caode in node-sqlite to add an update callback. On running the code I am getting a

Re: [sqlite] Need Help! -- SQlite database on server

2011-08-05 Thread Antonio Maniero
I'm reading about: http://www.atensoft.net/dev/sqlite3.php http://www.sqliteconcepts.org/CS_index.html http://www.sqlitening.com http://www.codeproject.com/KB/database/SQLite_Server.aspx http://www.realsoftware.com/realserver/ http://sqliteserver.xhost.ro/index.html http://users.libero.it/irwin/

Re: [sqlite] Need Help! -- SQlite database on server

2011-08-05 Thread Marco Bambini
Please take a look at cubeSQL: http://www.sqlabs.com/cubesql.php -- Marco Bambini http://www.sqlabs.com On Aug 4, 2011, at 7:15 PM, Vinoth raj wrote: > Dear SQLite users, > > I have been using SQlite database since three years. Suddenly I have a > requirement for client/server support

Re: [sqlite] Need Help! -- SQlite database on server

2011-08-05 Thread Wiktor Adamski
http://www.sqlite.org/cvstrac/wiki?p=SqliteNetwork ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Need Help! -- SQlite database on server

2011-08-04 Thread Alexey Pechnikov
2011/8/4 Vinoth raj : > So, the requirement is to save sqlite database on a server from a C++ > application. There are a lot of ways to copy file to server. SQLite database is single file. And you can send SQL dump. And you can send diff of SQL dump. And you can export your

Re: [sqlite] Need Help! -- SQlite database on server

2011-08-04 Thread Tim Butterfield
On Thu, Aug 4, 2011 at 12:52 PM, Stephan Beal wrote: > On Thu, Aug 4, 2011 at 7:50 PM, Stephan Beal wrote: > >> http://www.sqlite.org/whentouse.html >> > > Specifically: 2nd section, 1st list item. It may depend on the usage. After reading about

Re: [sqlite] Need Help! -- SQlite database on server

2011-08-04 Thread Kevin Martin
On 4 Aug 2011, at 18:15, Vinoth raj wrote: > I have been using SQlite database since three years. Suddenly I have a > requirement for client/server support for my project. > So, the requirement is to save sqlite database on a server from a C++ > application. We use sqlite in a client/server

Re: [sqlite] Need Help! -- SQlite database on server

2011-08-04 Thread Stephan Beal
On Thu, Aug 4, 2011 at 7:50 PM, Stephan Beal wrote: > http://www.sqlite.org/whentouse.html > Specifically: 2nd section, 1st list item. -- - stephan beal http://wanderinghorse.net/home/stephan/ ___ sqlite-users mailing list

Re: [sqlite] Need Help! -- SQlite database on server

2011-08-04 Thread Stephan Beal
On Thu, Aug 4, 2011 at 7:15 PM, Vinoth raj wrote: > It would be a great help if you can shed some light on my problem. Is it > possible at all to save SQLite database on a server? > http://www.sqlite.org/whentouse.html -- - stephan beal

[sqlite] Need Help! -- SQlite database on server

2011-08-04 Thread Vinoth raj
Dear SQLite users, I have been using SQlite database since three years. Suddenly I have a requirement for client/server support for my project. So, the requirement is to save sqlite database on a server from a C++ application. I explored the SQLite API with no success. Even numeours queries on

Re: [sqlite] need help with a query using datetime

2011-06-17 Thread Igor Tandetnik
Black, Michael (IS) wrote: > sqlite> create table t(d date); > sqlite> insert into t values('2011-12-31 09:00'); > sqlite> insert into t values('2011-12-31 12:15'); > sqlite> select d,substr(datetime(d,'-12 hours'),1,16) from t; > 2011-12-31 09:00|2011-12-30 21:00 >

Re: [sqlite] need help with a query using datetime

2011-06-17 Thread Ruth Ivimey-Cook
On 17/06/2011 12:10, looki wrote: > First column holds the givin datetime from my table and the second column > should show the datetime from first row but 12 hours before. for example: > > '2011-12-31 09:00' '2011-12-30 21:00' > '2011-12-31 12:15' '2011-12-30 00:15' > ... > > looks simple but

Re: [sqlite] need help with a query using datetime

2011-06-17 Thread Black, Michael (IS)
lack Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of looki [looki1...@yahoo.com] Sent: Friday, June 17, 2011 6:10 AM To: sqlite-users@sqlite.org Subject: EXT :[

[sqlite] need help with a query using datetime

2011-06-17 Thread looki
Hi, i have a table which holds dates like '2011-12-31 09:00' and i now want to write a query which gives me 2 columns. First column holds the givin datetime from my table and the second column should show the datetime from first row but 12 hours before. for example: '2011-12-31 09:00'

Re: [sqlite] Need help constructing some simple commands

2011-05-27 Thread Igor Tandetnik
don wish wrote: > Thus, if the "Subject" column does not contain the string "last", I > want to replace the "Value" with an integer, say "5". > > Also, if the "Subject" column contains the string "current", I want > to replace the "Value" witn an integer, say "3". What

[sqlite] Need help constructing some simple commands

2011-05-27 Thread don wish
   To start, I am not an SQLite user. i haven't used a database for    many years and have never used an SQL database.    I am on a MS Windows system. I have an application that uses SQLite as a    database for storing its information.    The name of the file containing the database is

Re: [sqlite] Need help understanding how to post to this list

2011-05-03 Thread Mr. Puneet Kishor
On May 3, 2011, at 6:04 PM, Rolf Marsh wrote: > Hello.. I just joined today and can't seem to figure out how to start a > new thread... Can someone please enlighten me? You just did. Just post a question with the subject line indicating clearly what is bothering you and take a seat. The

[sqlite] Need help understanding how to post to this list

2011-05-03 Thread Rolf Marsh
Hello.. I just joined today and can't seem to figure out how to start a new thread... Can someone please enlighten me? Regards, Rolf ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Need help

2011-03-31 Thread Oliver Peters
Igor Tandetnik writes: > > Balasubramani Vivekkanandan wrote: > >I am very new database development and sqlite. I have a requirement > > where I want to restrict the size of my integer primary key to 3 bytes. > > In my database, entries will be added and

Re: [sqlite] Need help

2011-03-31 Thread Oliver Peters
Igor Tandetnik writes: > > Balasubramani Vivekkanandan wrote: > >I am very new database development and sqlite. I have a requirement > > where I want to restrict the size of my integer primary key to 3 bytes. > > In my database, entries will be added and

Re: [sqlite] Need help

2011-03-31 Thread Igor Tandetnik
Balasubramani Vivekkanandan wrote: >I am very new database development and sqlite. I have a requirement > where I want to restrict the size of my integer primary key to 3 bytes. > In my database, entries will be added and removed very frequently. So If the > primary

[sqlite] Need help

2011-03-31 Thread Balasubramani Vivekkanandan
Hello, I am very new database development and sqlite. I have a requirement where I want to restrict the size of my integer primary key to 3 bytes. In my database, entries will be added and removed very frequently. So If the primary key limit of 3 bytes is reached, it should try to reuse the

Re: [sqlite] Need help to confirm my understanding on Foreign Key indexes

2011-02-28 Thread Simon Slavin
On 28 Feb 2011, at 9:41am, rf rf wrote: > Looking at the documentation for the latest version I think I understand that > I must define indexes for all foreign keys, manually, with UNIQUE as > described in the documentation. If I don't then the database will give me an > immediate or

[sqlite] Need help to confirm my understanding on Foreign Key indexes

2011-02-28 Thread rf rf
Looking at the documentation for the latest version I think I understand that I must define indexes for all foreign keys, manually, with UNIQUE as described in the documentation.  If I don't then the database will give me an immediate or deferred error.  These Foreign Key indexes are NOT

Re: [sqlite] need help on escaping the ']' character in the identifier

2010-12-07 Thread Richard Hipp
On Tue, Dec 7, 2010 at 3:49 AM, 곽현미 wrote: > Anyone please give me an advise, > > when i try the query below, > > CREATE TABLE "Test]" (no INTEGER), > > sqlite gives me the 'unrecognized token: "]" ' result. > It works when I try it. What version of SQLite are you using?

Re: [sqlite] need help on escaping the ']' character in the identifier

2010-12-07 Thread Drake Wilson
Quoth Philip Graham Willoughby , on 2010-12-07 10:57:45 +: > Use the right quotes, single not double; this works for me: > > create table 'test]' (no integer); Yagh! Please don't call those the 'right' quotes in this case. Quoth

Re: [sqlite] need help on escaping the ']' character in the identifier

2010-12-07 Thread Philip Graham Willoughby
On 7 Dec 2010, at 08:49, 곽현미 wrote: > Anyone please give me an advise, > > when i try the query below, > > CREATE TABLE "Test]" (no INTEGER), > > sqlite gives me the 'unrecognized token: "]" ' result. > > Is there a way to escape the ']' character in the identifier? Use the right quotes,

[sqlite] need help on escaping the ']' character in the identifier

2010-12-07 Thread 곽현미
Anyone please give me an advise, when i try the query below, CREATE TABLE "Test]" (no INTEGER), sqlite gives me the 'unrecognized token: "]" ' result. Is there a way to escape the ']' character in the identifier? Thanks, hyunmi. ___ sqlite-users

Re: [sqlite] Need help with self-join (I think)

2010-09-26 Thread Kristoffer Danielsson
Nice :) > To: sqlite-users@sqlite.org > From: itandet...@mvps.org > Date: Sat, 25 Sep 2010 10:21:18 -0400 > Subject: Re: [sqlite] Need help with self-join (I think) > > Kristoffer Danielsson <kristoffer.daniels...@live.se> wrote: > >> From: oliver@web.

Re: [sqlite] Need help with self-join (I think)

2010-09-25 Thread Oliver Peters
Igor Tandetnik writes: [..] > > See how you like this one: > > select * > from (select distinct year from Test) as AllYears > join (select distinct name from Test) as AllNames > left join Test t on (t.year=AllYears.Year and t.name=AllNames.name) > left join

Re: [sqlite] Need help with self-join (I think)

2010-09-25 Thread Igor Tandetnik
Kristoffer Danielsson wrote: >> From: oliver@web.de >> a little mistake - here's the correction: >> >> SELECT DISTINCT t.Year, b.Name, >> (SELECT SomeValue FROM Test INNER JOIN Test2 WHERE Year = t.Year AND Name = >> b.Name) AS SomeValue >> FROM Test t >> CROSS

Re: [sqlite] Need help with self-join (I think)

2010-09-25 Thread Kristoffer Danielsson
ot;fail", which increases the chances of doing mistakes. > Date: Sat, 25 Sep 2010 02:47:05 +0200 > From: oliver@web.de > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Need help with self-join (I think) > > Am 25.09.2010 01:47, schrieb Kristoffer Danielsson: > &g

Re: [sqlite] Need help with self-join (I think)

2010-09-24 Thread Oliver Peters
Am 25.09.2010 01:47, schrieb Kristoffer Danielsson: [...] > > Because, given a certain algorithm, generating statistics will become a lot > easier if each value combination is represented in the returned row set. > really? NULL means there are no values present or there are unknown values -

Re: [sqlite] Need help with self-join (I think)

2010-09-24 Thread Kristoffer Danielsson
Yeah. USING is good to have :) And yes, 123 might very well be a random number. I should have made that clear! > To: sqlite-users@sqlite.org > From: oliver@web.de > Date: Sat, 25 Sep 2010 00:19:44 + > Subject: Re: [sqlite] Need help with self-join (I think) >

Re: [sqlite] Need help with self-join (I think)

2010-09-24 Thread Oliver Peters
st INNER JOIN Test2 USING(TestID) WHERE Year = t.Year AND Name = b.Name) AS SomeValue FROM Test t CROSS JOIN (SELECT DISTINCT Name FROM Test) b ; > possible to remove the rest? > > Again, thanks! > > > > To: sqlite-us...@... > > From: oliver@... > > Date: Sat,

Re: [sqlite] Need help with self-join (I think)

2010-09-24 Thread Kristoffer Danielsson
Ah, this one's easier to follow. What do you mean by "in this case"? What was the condition that made it possible to remove the rest? Again, thanks! > To: sqlite-users@sqlite.org > From: oliver@web.de > Date: Sat, 25 Sep 2010 00:05:11 +0000 > Subject: Re: [sqlit

Re: [sqlite] Need help with self-join (I think)

2010-09-24 Thread Oliver Peters
sry, a little mistake - here's the correction: SELECT DISTINCT t.Year, b.Name, (SELECT SomeValue FROM Test INNER JOIN Test2 WHERE Year = t.Year AND Name = b.Name) AS SomeValue FROM Test t CROSS JOIN (SELECT DISTINCT Name FROM Test) b ; (results don't differ - in this case!) Oliver

Re: [sqlite] Need help with self-join (I think)

2010-09-24 Thread Kristoffer Danielsson
Neat! Many thanks :) Putting this logic together with my original query will be an interesting challenge, hehe. Do you believe this is the best solution? Chris > To: sqlite-users@sqlite.org > From: oliver@web.de > Date: Fri, 24 Sep 2010 23:47:59 + > Subject: Re: [

Re: [sqlite] Need help with self-join (I think)

2010-09-24 Thread Oliver Peters
Kristoffer Danielsson writes: SELECT DISTINCT t.Year, b.Name, CASE WHEN (SELECT TestID FROM Test WHERE Year = t.Year AND Name = b.Name) IS NULL THEN NULL ELSE (SELECT SomeValue FROM Test2) END AS SomeValue FROM Test t CROSS JOIN (SELECT DISTINCT Name FROM Test) b ;

Re: [sqlite] Need help with self-join (I think)

2010-09-24 Thread Kristoffer Danielsson
come a lot easier if each value combination is represented in the returned row set. Perhaps a UNION is needed for this type of query? > Date: Fri, 24 Sep 2010 18:17:51 -0500 > From: nicolas.willi...@oracle.com > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Need help w

Re: [sqlite] Need help with self-join (I think)

2010-09-24 Thread Nicolas Williams
On Sat, Sep 25, 2010 at 01:01:36AM +0200, Kristoffer Danielsson wrote: > CREATE TABLE Test (TestID INTEGER PRIMARY KEY, Year INT NOT NULL, Name TEXT > NOT NULL); > INSERT INTO Test (Year, Name) VALUES (2007, 'A'); > INSERT INTO Test (Year, Name) VALUES (2007, 'B'); > INSERT INTO Test (Year, Name)

[sqlite] Need help with self-join (I think)

2010-09-24 Thread Kristoffer Danielsson
Hi, I have an interesting SQL problem where I want certain rows to always be represented. It feels like a self-join, but I'm not sure. Please help! Create a database as follows: CREATE TABLE Test (TestID

Re: [sqlite] Need help understanding the basic of C++/sqlite

2010-01-22 Thread Raoul
Thanks all for your input. Thanks to your feedback I have been able to advance quite a long way in my studies... And yes my big problem is in fact understanding C++ (still in learning phase). 4) I will check if this option is avaialable too on the express edition. 5) I did try to install

Re: [sqlite] Need help understanding the basic of C++/sqlite

2010-01-19 Thread Simon Davies
2010/1/19 Fabrice NA : > Hi all, > > I am trying to understand Sqlite and to make thing worse I am also learning > C++. You will not be surprised that I find it really hard to understand the > C++ example on the web. Can someone guide me to digest this? If you can > explain

Re: [sqlite] Need help understanding the basic of C++/sqlite

2010-01-19 Thread a1rex
it helps, Samuel From: noel frankinet <noel.franki...@skynet.be> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Sent: Tue, January 19, 2010 9:18:06 AM Subject: Re: [sqlite] Need help understanding the basic of C++/sqlite Fabrice NA a

Re: [sqlite] Need help understanding the basic of C++/sqlite

2010-01-19 Thread noel frankinet
Fabrice NA a écrit : Hi, In sqlite3_exec, you pass a function pointer (callback). Sqlite call that function with each row of data Best wishes Noël > Hi all, > > > > I am trying to understand Sqlite and to make thing worse I am also learning > C++. You will not be surprised that I find it

[sqlite] Need help understanding the basic of C++/sqlite

2010-01-19 Thread Fabrice NA
Hi all, I am trying to understand Sqlite and to make thing worse I am also learning C++. You will not be surprised that I find it really hard to understand the C++ example on the web. Can someone guide me to digest this? If you can explain please do so by extrapolating since I am a total

Re: [sqlite] Need help constructing a query

2009-11-11 Thread Igor Tandetnik
Jörgen Hägglund wrote: > Hi all! > I have three tables, one containing IP addresses as integers, lets > call > it 'base'. > A second table containing IP ranges and the country code the range > belongs to. Lets call this 'IPtoCC' with the fields IPFrom and IPTo as >

Re: [sqlite] Need help constructing a query

2009-11-11 Thread Jay A. Kreibich
On Wed, Nov 11, 2009 at 09:36:41AM -0600, P Kishor scratched on the wall: > 2009/11/11 Jörgen Hägglund : > > Hi all! > > I have three tables, one containing IP addresses as integers, lets call > > it 'base'. > > A second table containing IP ranges and the country code

Re: [sqlite] Need help constructing a query

2009-11-11 Thread P Kishor
2009/11/11 Jörgen Hägglund : > Hi all! > I have three tables, one containing IP addresses as integers, lets call > it 'base'. > A second table containing IP ranges and the country code the range > belongs to. Lets call this 'IPtoCC' with the fields IPFrom and IPTo as >

[sqlite] Need help constructing a query

2009-11-11 Thread Jörgen Hägglund
Hi all! I have three tables, one containing IP addresses as integers, lets call it 'base'. A second table containing IP ranges and the country code the range belongs to. Lets call this 'IPtoCC' with the fields IPFrom and IPTo as integers and CC as text. Then a third, 'Exclude', containing

Re: [sqlite] Need Help SQL

2009-10-13 Thread Rick Ratchford
Thanks! Cheers! #>-Original Message- #>From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- #>boun...@sqlite.org] On Behalf Of sub sk79 #>Sent: Monday, October 12, 2009 9:35 PM #>To: General Discussion of SQLite Database #>Subject: Re: [sqlite] Need Help SQL #

Re: [sqlite] Need Help SQL

2009-10-12 Thread sub sk79
Hi!, Here is a non-math version using PL/SQL date operators and functions available in StepSqlite (https://www.metatranz.com/stepsqlite/). Hopefully this should be easier to follow. You can compile the below code directly to a win32 dll on the StepSqlite website and then use it in your VB code.

Re: [sqlite] Need Help SQL

2009-10-12 Thread Igor Tandetnik
Rick Ratchford wrote: > Your code: > > ((:EndMonth - :StartMonth) * 100 + (:EndDay - :StartDay) + 1300) % > 1300 > > VB: > > (" & lngEndMth - lngStartMth) & ") * 100 + " & ((lngEndDay - > lngStartDay) + 1300) Mod 1300 > > In the VB version, I'm simply doing all the

Re: [sqlite] Need Help SQL

2009-10-12 Thread RB Smissaert
org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rick Ratchford Sent: 12 October 2009 20:16 To: 'General Discussion of SQLite Database' Subject: Re: [sqlite] Need Help SQL #>Doesn't your VB SQLite binding support parameterized statements? If so, #>I'd suggest you dump it and find a b

Re: [sqlite] Need Help SQL

2009-10-12 Thread Rick Ratchford
#>> Here is that string from your earlier example: #>> #>> sSQL = "SELECT Date, Month, Day, Open, High, Low, Close FROM [" & #>> gsTableName & "] " & "WHERE ((Month - " & lngStartMth & ")*100 + (Day #>> - " & #>> lngStartDay & ") + 1300) % 1300 <= " & lngEndMth - lngStartMth & " * #>> 100 + " &

Re: [sqlite] Need Help SQL

2009-10-12 Thread Rick Ratchford
#>Doesn't your VB SQLite binding support parameterized statements? If so, #>I'd suggest you dump it and find a better one. #> #>Igor Tandetnik I'm not up on the terminology. I'm using Olaf Schmidt's VB SQLite binder. He'd probably be better to answer this question than I. :-) Rick

Re: [sqlite] Need Help SQL

2009-10-12 Thread Igor Tandetnik
Rich Shepard wrote: > On Sun, 11 Oct 2009, Igor Tandetnik wrote: > >> I simply combine (month, day) pair into a single number - the same >> way you combine two digits of a decimal number by multiplying the >> first by 10 and adding the second. The multiplier doesn't have

Re: [sqlite] Need Help SQL

2009-10-12 Thread Rich Shepard
On Sun, 11 Oct 2009, Igor Tandetnik wrote: > I simply combine (month, day) pair into a single number - the same way you > combine two digits of a decimal number by multiplying the first by 10 and > adding the second. The multiplier doesn't have to be 100 - any number > greater than 31 will do.

Re: [sqlite] Need Help SQL

2009-10-12 Thread Igor Tandetnik
Rick Ratchford wrote: > #>There is a slight complication with the case where endDate < > startDate, #>where you want to wrap around to next year. For that, I > simply need to #>perform calculations modulo a large number - any > number greater than the #>representation of 12/31 in my scheme. 1300 >

Re: [sqlite] Need Help SQL

2009-10-11 Thread Rick Ratchford
#>There is a slight complication with the case where endDate < startDate, #>where you want to wrap around to next year. For that, I simply need to #>perform calculations modulo a large number - any number greater than the #>representation of 12/31 in my scheme. 1300 is one such number. #> #>Igor

Re: [sqlite] Need Help SQL

2009-10-11 Thread Rick Ratchford
Tandetnik #>Sent: Friday, October 09, 2009 6:46 PM #>To: sqlite-users@sqlite.org #>Subject: Re: [sqlite] Need Help SQL #> #>Rick Ratchford <r...@amazingaccuracy.com> #>> Data Fields: ID, Date, Month, Day, Year, Price #>> #>> Problem: When provided the star

Re: [sqlite] Need Help SQL

2009-10-09 Thread Rick Ratchford
Thank you Igor. I will. :-) Cheers! Rick #>-Original Message- #>From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- #>boun...@sqlite.org] On Behalf Of Igor Tandetnik #>Sent: Friday, October 09, 2009 6:46 PM #>To: sqlite-users@sqlite.org #>Subject: Re: [sql

Re: [sqlite] Need Help SQL

2009-10-09 Thread Igor Tandetnik
Rick Ratchford > Data Fields: ID, Date, Month, Day, Year, Price > > Problem: When provided the starting Month/Day numbers, and ending > Month/Day numbers, what is the correct way to SQL the database so > that the recordset created returns as follows (assume 4 years of

[sqlite] Need Help SQL

2009-10-09 Thread Rick Ratchford
I'm trying to correctly word an SQL statement. Data Fields: ID, Date, Month, Day, Year, Price Problem: When provided the starting Month/Day numbers, and ending Month/Day numbers, what is the correct way to SQL the database so that the recordset created returns as follows (assume 4 years of

Re: [sqlite] Need help To Get Started with SQLITE

2009-10-03 Thread jack
Thanks. Obviously it's going to take awhile to remember my C. Jack - Original Message - From: "Dan Kennedy" <danielk1...@gmail.com> To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> Sent: Saturday, October 03, 2009 1:05 PM Subjec

Re: [sqlite] Need help To Get Started with SQLITE

2009-10-03 Thread Dan Kennedy
On Oct 4, 2009, at 12:01 AM, jack wrote: > I just setting out to learn how to use sqlite3 (3.6.18). Obviouly > I'm missing some very important points. > > The very simple test app below is to open (and create) an sql > datbase then close it > > Using windows XP. Using a precompiled .LIB. I

[sqlite] need help, sqlite produces errors

2009-05-06 Thread leife
at first let me say: this doesn't run on my pc, but on a Popcorn-Hour A110 Mediaserver. That is a problem, because i can't predict the behaviour of sqlite or php and i can't get real error message (Just one general Message which occurs for all things). i have a function that scans a folder which

Re: [sqlite] Need help with the SQL statement.

2009-04-16 Thread Joanne Pham
Thanks a ton Igor! It worked. Your help is greatly appreciated. Thanks, JP From: Igor Tandetnik <itandet...@mvps.org> To: sqlite-users@sqlite.org Sent: Thursday, April 16, 2009 4:52:28 AM Subject: Re: [sqlite] Need help with the SQL statement. "

Re: [sqlite] Need help with the SQL statement.

2009-04-16 Thread Igor Tandetnik
"Joanne Pham" wrote in message news:348376.69121...@web90302.mail.mud.yahoo.com > 20657220 is number of minutes in GMT time zone. > So we need to convert to second by 20657220 *60. > select datetime(20657220*60, 'unixepoch','localtime' ); > will be 2009-04-11 00:00:00 In

Re: [sqlite] Need help with the SQL statement.

2009-04-16 Thread Joanne Pham
org> To: sqlite-users@sqlite.org Sent: Wednesday, April 15, 2009 9:17:09 PM Subject: Re: [sqlite] Need help with the SQL statement. "Joanne Pham" <joannekp...@yahoo.com> wrote in message news:872428.4795...@web90308.mail.mud.yahoo.com > But the first row (20657220 1 2 101 --

  1   2   >