Tag Info

New answers tagged

0

> SELECT hex(CompanyName) FROM Customers WHERE CustomerID = 'BOLID'; 42F36C69646F20436F6D696461732070726570617261646173 This is not valid UTF-8. That database was not created correctly. If you know what the characters are supposed to be, you could manually fix them: UPDATE Customers SET CompanyName = replace(CompanyName, x'F3', 'รณ'); (You'd have to ...


2

Your question says two tables but your example shows three. I'm going to take table_3 as the association table between table_1 and table_2, showing data which actually exists. To get all possible combinations of two tables you need a CROSS JOIN. The number of rows returned is the product of the number or rows in each table. Be careful as this can get very ...


0

You are missing a webserver_id column in the TEST table. CREATE TABLE test(id integer primary key AUTOINCREMENT , page varchar(10) , dp_record_id integer , webserver_id integer , foreign key (webserver_id) REFERENCES target_dp(id)); Works just fine.


1

Assuming your surrogate keys are auto-incrementing integers marked as primary keys they will be the "rowid" for that table so you can read the last value added for a single insert using SELECT last_insert_rowid(). This operates like scope_identity in other databases. You would need to read each one after each row insert as each will replace record of the ...


0

I agree with EBrown, but I think the problem is spaces. "CREATE TABLE %s (" + "_id INTEGER PRIMARY KEY AUTOINCREMENT, " + "%s TEXT" + " %s LONGITUDE" + "%s LATITUDE)", You don't appear to have spaces between your strings. It's been a while since I've done much coding, but maybe you have a table with one ...


0

You're issue appears to be in your SQL syntax, you missed multiple commas: String.format("CREATE TABLE %s (" + "_id INTEGER PRIMARY KEY AUTOINCREMENT, " + "%s TEXT" + ", %s LONGITUDE, " + "%s LATITUDE)", TaskContract.POI_NAMES, TaskContract.Columns.POI, ...


3

You explain: I get result 1453 only when all items in column attributeY are empty for 1453. But that's incorrect. Bold emphasis mine. The aggregate function count returns (per documentation): number of input rows for which the value of expression is not null The same is true for SQLite (per documentation): The count(X) function returns a ...


2

It works for me with a similarly created structure. You didn't provide DDL and INSERTs for your table so I just made up a shorter one that should have the same effect: $ sqlite3 test.db SQLite version 3.8.8.3 2015-02-25 13:29:11 sqlite> CREATE TABLE test(x integer, y text); sqlite> INSERT INTO test(x, y) VALUES (1, ''); sqlite> INSERT INTO test(x, ...


0

Running EXPLAIN QUERY PLAN on your query gives this: 0|0|0|SCAN TABLE LEGS AS l 0|0|0|EXECUTE LIST SUBQUERY 1 1|0|5|SEARCH TABLE TRAVELDAYS AS d USING AUTOMATIC PARTIAL COVERING INDEX (Day=? AND Value=?) 1|1|4|SEARCH TABLE TRAINS AS t USING AUTOMATIC COVERING INDEX (TrainDaysUID=?) 1|2|0|SEARCH TABLE LEGS AS l USING AUTOMATIC COVERING INDEX (TrainUID=?) ...


0

When the order of pages in the file has no relation to the order of pages on the disk, reordering the file does not make sense.



Top 50 recent answers are included