On 2014/06/20 07:20, David M. Cotter wrote:
i want to delete from the table all records with plID = 1, but ONLY those that 
have a corresponding record where plID == 851090 and where that record's soID 
matches the one where plID = 1

so the query should delete rows 8-12, but leave 1-2 intact (and also leave 3-7)

there may be many other plID numbers

is there some really great reference that y'all go to for crazy queries like 
this?

Hi David,

Igor answered the query question very well I think (should work as you asked for), as to the other question about where to go - well, this list is just such a resource and there are many web resources with details about querying and the intricacies of SQL, some of them run by the very people posting here.

What you do need though, is to get into the whole SQL thing and learn a bit more about Relational Databasing in general I think. The reason I think this, is that it is clear that you think your questions or intended queries were supposed to be "hard" - but to be quite honest, they are rather "light" or "easy" (as Igor elegantly showed) compared to the querying that mostly make the list folk scratch their heads.

All this means is that I think you will be amazed at finding out what all you can do with SQL querying (not just for SQLite) and that this usually can save a programmer an immense amount of time and/or programming once the data is in the correct formats and tables and the SQL can do most of the work for you.

Typical resources on the web include the very "SQL as Understood by SQLite" 
pages from our own beloved SQLite's web pages over at:
www.sqlite.org.

Further maybe some SQL explanations from w3-Schools over at:
http://www.w3schools.com/sql/
(I really like this one since it has an editor thing where you can type your 
queries and see their effects right away).

Also from one of our list members, a great resource on more technically weird 
and wonderful SQL over at:
http://www.schemamania.org/

Conclusion: SQL is awesome in all its flavours - it will save you immense 
amounts of development time - get into it!


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

Reply via email to