I have two tables, one for all the foods which contains food id, default name and other foods values. Another table is for the food name translations which contains food id, language id, translation. What i want to do is join between these tables by the food id to get the translation for food id = 5 for example and
Tag: sqlite
Android Studio Null object Reference
Creating an question/answer test application that scores you based on how many attempts it took to get it right (i.e on the first attempt 5 points, 2nd attempt 4 points… and so on) the questions are stored in a .DB file in asset folder and after testing the scoring logic I’m now trying to draw from the database. this is
SQL insert choice of column name dependant on select value
Hope the title is a reasonable description. I have 2 tables in a db (sqlite). CREATE TABLE files ( name TEXT, sha256 TEXT, fsno INT ); CREATE TABLE sha256 ( sha256 TEXT, fs1 INT, fs2 …
How to sum COUNT values
I’m very new to SQLite so please forgive me asking something stupid. From a database with a table containing aircraft data I can count the records with data from a manufacturer with my existing query: …
Is it possible to select multiple offsets with SQL
I’d like to select multiple offsets with a single SELECT SQL query. Is this possible? For example, let’s say I have a table of non-continuous dates called dates. I’d like to select the 1st, 4th and 7th offsets from the most recent date. In this example, the query should return: Ideally, I would like to write the query as follows:
Row Value Comparison Alternatives?
I’m working in a C# SQLite library (SQLite-net) that doesn’t seem to support row value comparisons like this: I get an error message at the first comma. Is there a long form way of doing the same comparison that could be compatible with older SQLite implementations? I’m no expert in SQL but I’ve tried a few ways of comparing the
SQLite – Sort and get the number in the list
sql.all(`SELECT * FROM users ORDER BY points DESC`).then() How can I sort the list and get the current number on the list? Example: LIST: USERID | POINTS 1 | 20 2 | 100 3 | 67 VAR MYID = 1 Output: …
Why do I fail to save data in my application?
I am a student and started working on android studio recently. I don’t know about it much. I am working on an application where I save the item name and its amount in the database and display toast …
SQL: how to select distinct values with an offset
Given the following table: id value ——- ——- 0 1 1 6 2 7 3 9 4 2 5 20 6 21 7 3 I’m wondering if there’s a way to select distinct rows where there’s a difference between (integer) values of (for example) 3, giving a priority to id (low id value = more prioririty). Programmatically, I would iterate
SQL: Using CASE over TABLE that has been GROUPED
I am working with an SQLite Database that has a table CarUse with three fields CarID (VARCHAR(20)), tDate (VARCHAR(20), and Kms (INT). The goal is to create a table that will summarise the Kms over …