I have a query with a condition but it is returning an empty result even though I have the data that matches these conditions. I am a beginner, so I’m not sure if this query is correct. public Cursor …
Tag: sqlite
SQL query to select from multiple tables and create third table
Can someone please help me with a SQL query? My apologies if a similar question has been asked before. Finding it difficult from other examples I have seen. I have 2 tables and would like to create a …
From sqlite syntax to mysql syntax
I’m having some troubles moving from sqlite syntax to mysql syntax. Does anybody know a ressource showing the basic syntax in sqlite and its equivalent in mysql ? In my particular case, I want to transform this sqlite code into mysql one: For the moment, I did that: DROP TABLE IF EXISTS post; But I got errors with CURRENT_TIMESTAMP() and
Using sql to recursively generate values depending on keys and column values
I have a table like this: store item value store1 item1 2 store1 item2 3 I want to use it to create the following table: store item value store1 item1 0 store1 item1 1 store1 item1 2 store1 …
SQLite book shop: Last students and all books they ordered
forum. I’m trying to run SQL for my local book-shop. The problem is to show last N students and all books they ordered. My try: Is it okay code? Syntax check only shows mistake in a row 8, which I don’t get. Thank you in advance Answer You can join books to orders and filter the results for the last
SQLite: How to see people that aren’t my friend, but are friends with my friends
I have a database in DB Browser where I have two tables; So my question is, how do I make a query that Displays People that I’m not friends with, but my friends are friends with them. It’s so I can find new friends basically. Answer You can join multiple times:
sqlite3.OperationalError: ambiguous column name: views
Help! I try to update the select statement but it seems to not work here So, let me introduced my table Artists and Songs Note:I already inserted these table yet and, this is where I update SELECT statement and cause me an error This is the error So I decided to change from views to Songs.views and, it still gave
SQL query – List albums where every song matches criteria
I am analyzing my music database which uses SQLite. I am trying to get a list of all albums where all the songs on that album having a rating of 10 or less. Some contrived data for the example: Using this example data, I would want my query to return “Presence” since all the songs on that album have a
Is there an SQL statement that can return maximum values of a column from a table for each of the groups resulting from groupby another column?
I would like to know if we can generate a single SQL statement that; Groups rows in a relational table to n groups based on a given column col_1 Reports the maximum value for each of the groups based on another column col_2. e.g. A dataset has many makes of cars and their respective costs and so we need to
How can I use WHERE with multiple different columns?
Having trouble trying to query AND and OR in an SQlite3 statement. Is there a way where I can do something like WHERE section = ? AND LEVEL =? AND subj1 =? AND subj2=? AND subj3 =? From what I see in this particular line It won’t work because after ‘AND subj1 =?’ SQlite3 now chooses to select whatever subject