I have a query based on the answer to this question: http://stackoverflow.com/questions/2939061/handling-ties-when-ranking-from-the-highest-to-the-lowest/2939079#2939079
Given this dataset:
Name | Score
Mike | 5
John | 3
Mary | 3
Matt | 0
The following query returns a user array containing the correct values.
User.find_by_sql("SELECT...
we are currently trying to package sqlite3 and sqlite3-ruby with an application that will be released as open source (ruby/rails based)
i am evaluating if it is possible to package sqlite3-ruby for windows/linux and mac.
my thoughts were, to download sqlite3-amalgamation, sqlite3-ruby on all the platforms and then compile on each.
here ...
I have a database with a field for a stored date. I would like to be able calculate the days between the recorded date and today.
I ended up using:
mDb.execSQL("UPDATE "+DATABASE_PLANTS_TABLE+" SET "+ KEY_PLANT_DAYS+
" = (SELECT julianday('now') - julianday("+KEY_DATE+") FROM"+ DATABASE_PLANTS_TABLE+")");
...
So I don't know the geek speak here, but I'm trying to do the following:
SQL:
BEGIN TRANSACTION;
INSERT INTO Core_User (FirstName) VALUES (?);
INSERT INTO Core_User (FirstName) VALUES (?);
INSERT INTO Core_User (FirstName) VALUES (?);
COMMIT;
I've set the parameters:
For lngCount = 0 To cmdBatch.Parameters.Count - 1
Deb...
Hello all,
I'm new to Objectiv-C and i try to get my database SQLite to work, but i get sommene trobble i hobe i can get sommen help here.
That i will have my code to doe its bind all "region_title" to tableview, and "region_id" to the id like "html" when you use "options"
i have try to search about it but i can't find help to my prob...
Say I have four tables, users, contacts, files, and userfiles.
Users can upload files and have contacts. They can choose to share their uploaded files with their contacts.
When a user selects one or more of their uploaded files, I want to show a list of their contacts that they are not already sharing all of their selected files with. ...
I am using android build target vendor version 2.2.
I want to access/read sqlite3 database file of an application A from an application B. Is it possible to do so? because i don't want to import that DB file of apps A in Apps B.
...
All I know is only table name, and id value on which I want to perform query, but I do not know what is id called in that table.
...
Iam having a database in Sqlite3. I am doing all my operations by writing application in Linux C(API:sqlite3_exec). Currently Iam trying to export the database to a text file. Can anyone suggest query statements fro the same.
...
hi,
I have a large table of around 2500 entries. I am displaying it on tableview. however the search bar is too slow while doing dynamic search. ie I am filtering the table everytime the user puts in a character on search bar.
following is the code:
- (void)searchBar:(UISearchBar *)theSearchBar textDidChange:(NSString *)searchText {
...
Hello,
I am trying to import a file as a table in SQLite 3 using a Ruby script. I need to assign a tab separator, and I used the following code:
db = SQLite3::Database.new("meshdb2.db")
db.execute("CREATE TABLE IF NOT EXISTS pubmed(id integer primary key,prideID INT NOT NULL,pubmedID VARCHAR(10) NOT NULL)
db.prepare(".separator '\t'")
...
Hi All, quicky question on SQLite3 (may as well be general SQLite)
How can one retrieve the nth row of a query result?
row_id (or whichever index) won't work on my case, given that the tables contain a column with a number. Based on some data, the query needs the data unsorted or sorted by asc/desc criteria.
But I may need to quickly ...
hey my problem is when i try to update my database it goes through the update query fine but then it crashes giving me a error in the console saying "Error while updating 'Database is locked'". Does any one have a clue why is it so?
...
I'm using a SQLite database to store information on players and their teams using android. I've got it working so that all the players I've created will show up when ever I start my program, so the database is working. So far, so good.
However, whenever I try to retrieve the rowId of a player from the database, it always gives me 0 back...
Using SQLite3 in Python, I am trying to store a compressed version of a snippet of UTF-8 HTML code.
Code looks like this:
...
c = connection.cursor()
c.execute('create table blah (cid integer primary key,html blob)')
...
c.execute('insert or ignore into blah values (?, ?)',(cid, zlib.compress(html)))
At which point at get the error:
...
Lets say I have a database with tables called box, item, and box_contents and I want to get any item that is contained in the box_content table (all items, but discard the ones that arent in the box_contents table). What would be the correct sqllite syntax for this?
...
Hello :)
I have sqlite3 database with example structure and data:
CREATE TABLE person(id INTEGER PRIMARY KEY NOT NULL, name STRING NOT NULL);
INSERT INTO "person" VALUES(1,'Jack');
INSERT INTO "person" VALUES(2,'Daniel');
INSERT INTO "person" VALUES(3,'Sam');
INSERT INTO "person" VALUES(4,'T`lc');
CREATE TABLE vote(person_id INTEGER NO...
As the database in my app grows, it is going to require more and more of the internal phone space. There isn't any sensitive/private data in the DB, so I'm interested in moving it to the SD card.
I'm using SQLiteOpenHelper to assist with the database work. It's my understanding that you can't use this for DB-access on the SD card as you...
I'm building a NSPredicate using the code below for an iPhone app. The logging shows the prediate to be: location CONTAINS "head" AND shape CONTAINS "oval" AND texture CONTAINS "bumpy" AND colour CONTAINS "red"
I get no results. If I limit the predicate to a single item it will work, more than 1 fails.
Can anyone tell me why?
Many tha...
I am using SQLite3. I load a table with say 30 rows using integer as Primary ID and it auto-increments.
Now I delete all the rows from the table and then, reload some new information onto the table.
Problem is: the row count (my PrimaryID) now starts with 31. Is there any way that I can start loading new rows from the number 1 onwards?...