Re: [sqlite] Merry Christmas
+1 = 4 -- The days of good English has went. -- We can either use our money to serve God or our god will be our money. On Dec 25, 2010, at 7:48, "Guy \(Hotmail\)"wrote: > +1 = 3 > > -Original Message- > From: TR Shaw > Sent: Saturday, December 25, 2010 7:46 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] Merry Christmas > > +1 > > On Dec 25, 2010, at 12:31 AM, Artur Reilin wrote: > >> Merry Christmas to the whole mailing list and your families :) >> >> >> Artur Reilin >> sqlite.yuedream.de >> ___ >> 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-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] beginner
I have that book, also, and it is OK, but I ordered it online and didn't realize how much of it was dedicated to incorporating SQLite into applications. Of course, "Using SQLite" is the title, after all... I have SQL for Dummies, too, which I think is a nice supplement. One more thing: there is an iPod Touch app which is a fully- functioning SQLite console and instructions. Awesome. George R. -- The days of good English has went. -- We can either use our money to serve God or our god will be our money. On Dec 17, 2010, at 10:01, "Jay A. Kreibich"wrote: > On Fri, Dec 17, 2010 at 08:42:54AM -0600, john darnell scratched on > the wall: > >> I am learning SQLite based on the O'Reilly book by Jay Kreibich, >> called "USING SQLITE," which came out in August of this year, so >> it's pretty up to date. > > I hope you're finding it useful. > >-j > > -- > Jay A. Kreibich < J A Y @ K R E I B I.C H > > > "Intelligence is like underwear: it is important that you have it, > but showing it to the wrong people has the tendency to make them > feel uncomfortable." -- Angela Johnson > ___ > 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] Inserting data using a compound SELECT
YES, that was it, thank you! It was a simple issue of the word "values" and the addition of the extra parentheses. I can see it now: the two SELECTS in parentheses are the equivalent of the "values" that would be entered. Looks simple after seeing it. Maybe I should have taken a step back for a couple of hours..and had more coffee!! To round out the question: I don't have Access at home, and I'm learning SQLite as an easier and more portable alternative to PostgreSQL. I don't use Windows at home, and don't want to. And the "why" of this particular query: I don't know any better...LOL. I'm tooling around with the database as I read my SQL books, and try experiments on the fly. Eventually I'll try to piece together a nice functioning GUI or a better web-based movie database than I have now, but it'll take a little while. Thank you again for your reples! This list has been very helpful and educational! George R. Igor Tandetnik wrote: > Drake Wilsonwrote: > >> INSERT INTO "cast" (titleID, castID) >>((SELECT titleID FROM titles WHERE title = 'Alien'), >> (SELECT artistID FROM artists WHERE lastname = 'Weaver')); >> > > Make it > > INSERT INTO "cast" (titleID, castID) > VALUES > ((SELECT titleID FROM titles WHERE title = 'Alien'), > (SELECT artistID FROM artists WHERE lastname = 'Weaver')); > > Note the added VALUES keyword. > -- www.andforthelamb.org www.outreachhockey.org They deem me mad for I will not sell my days for gold; I deem them mad for they think my days have a price. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Inserting data using a compound SELECT
Ah, yes, I'm sorry: I mistyped. I have "titleID" and "artistID" in that table. Puneet Kishor wrote: > > > George Roberge wrote: >> Greetings, all. >> >> I'm having trouble getting an insert statement to function properly, and >> am not sure if it is me, or this isn't supposed to be done. >> >> This is not the complete database, but to keep this issue simple: >> >> I have three tables: >> >> artists (artistID integer, lastname text) contains 1, 'Weaver' >> titles (titleID integer, title text) contains 1, 'Alien' >> cast (castID, artistID) > > > Note the definition of the table 'cast' -- it has columns 'castID' and > 'artistID') > >> >> I am experimenting with inserting data into the cast table using values >> that will be entered either by a user or selected from a list. In the >> meantime, I am manually entering the values "Weaver" and "Alien" to >> acquire title ID number and artist ID to store into the cast table. >> >> This simple statement works fine and yield the expected "1": insert into >> cast (titleID) select titleID from titles where title='Alien'; >> >> I get into trouble when I attempt to add the extra field: insert into >> cast (titleID, castID) select titleID from titles where title='Alien' > > > Note what you are trying to insert into cast above, namely 'titleID' > and 'castID'. Per your table definition, you have no 'titleID' in the > table 'cast' > > >> select artistID from artists where lastname='Weaver'; >> >> I know that the above syntax is incorrect. I have tried adding >> parentheses around the select statements (SELECT XXX), (SELECT XXX) and >> have tried the UNION in between, which I now understand adds separate >> rows into the table. I assumed that I could replace simple values with >> SELECT statements, but either I am wrong, or I have bogus syntax. >> >> I am new to using SQL outside of the "drag-and-drop" Access method, so >> this might be a silly question. >> >> If this can't be done I suppose I could add one value as a SELECT >> statement, then try to locate that row in the table and do an UPDATE to >> the other column (in this case, the cast column) where I just inserted >> the data. >> >> Thank you! >> George R. >> >> >> >> >> >> > > > -- www.andforthelamb.org www.outreachhockey.org They deem me mad for I will not sell my days for gold; I deem them mad for they think my days have a price. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Inserting data using a compound SELECT
Greetings, all. I'm having trouble getting an insert statement to function properly, and am not sure if it is me, or this isn't supposed to be done. This is not the complete database, but to keep this issue simple: I have three tables: artists (artistID integer, lastname text) contains 1, 'Weaver' titles (titleID integer, title text) contains 1, 'Alien' cast (castID, artistID) I am experimenting with inserting data into the cast table using values that will be entered either by a user or selected from a list. In the meantime, I am manually entering the values "Weaver" and "Alien" to acquire title ID number and artist ID to store into the cast table. This simple statement works fine and yield the expected "1": insert into cast (titleID) select titleID from titles where title='Alien'; I get into trouble when I attempt to add the extra field: insert into cast (titleID, castID) select titleID from titles where title='Alien' select artistID from artists where lastname='Weaver'; I know that the above syntax is incorrect. I have tried adding parentheses around the select statements (SELECT XXX), (SELECT XXX) and have tried the UNION in between, which I now understand adds separate rows into the table. I assumed that I could replace simple values with SELECT statements, but either I am wrong, or I have bogus syntax. I am new to using SQL outside of the "drag-and-drop" Access method, so this might be a silly question. If this can't be done I suppose I could add one value as a SELECT statement, then try to locate that row in the table and do an UPDATE to the other column (in this case, the cast column) where I just inserted the data. Thank you! George R. -- www.andforthelamb.org www.outreachhockey.org They deem me mad for I will not sell my days for gold; I deem them mad for they think my days have a price. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users