Tagged Questions
0
votes
1answer
14 views
MySQL/SQLite insert same random # to multiple rows
MySQL/SQLite
I want to insert a randomly generated number (of 9 positions) into multiple rows BUT they need to be the same for all rows matched in the query.
update products set tag_seed=( SELECT ...
1
vote
1answer
11 views
Sqlite inner join not working :s
SELECT id, subject
FROM pages AS a
INNER JOIN articles AS b ON a.subject = b.id
WHERE a.id = ?
It doesn't work, it says:
General error: 1 ambiguous column name: id.
But I made an alias of ...
1
vote
0answers
33 views
C# SQLite Parameters in SELECT statement - Dependent Comboboxes issue
I've been having some problems executing this query in SQLite in C# - Visual Studio 2008. I have 2 comboboxes, the second one depends on the value selected in the first one (i.e: Province --> valid ...
1
vote
2answers
37 views
SQLITE3 Sub-querys
I'm having a problem, that i can't figure it out, even after reserching here and at sqlite.org
So, I have these tables:
CREATE TABLE MEDICO(
idMedico INTEGER PRIMARY KEY AUTOINCREMENT,
nome ...
0
votes
1answer
38 views
Error with FMDB - unknown column name
I am trying to use a NSMutableArray to show some data from my sqlite database in my tableview.
When I use AssetDesc as my cell text I can see my description from my sqlite database in my UITableCell. ...
0
votes
1answer
30 views
Android sqlite return number of rows from query
I am trying to build a method to determine if a user exists in an Android sqlite database before inserting, I have tried to build this method to return the number of rows, however If I try a search ...
0
votes
1answer
7 views
sqllite select in where clause
I have a query that returns a list codes.
SELECT cc.code FROM lotw l
LEFT JOIN CountryCode AS cc on cc.code = l.dxcc
WHERE cc.code > '' GROUP BY cc.Country
...
1
vote
4answers
22 views
SQLITE: Select another column if the first one is null
I want to select the value from another column if there are no records in the first column (is null).
I want something like this:
SELECT (if Column1 IS NULL THEN Column2), Column3, Column4 FROM ...
0
votes
3answers
50 views
Select one random row from cycle of function with SQLite and Perl
Hi I tried to select one random number from this:
My source:
use DBI;
use CGI;
my $file = '.\input.txt'; # Name the file
open(FILE, $file) or die("Unable to open file");
my @data = ...
0
votes
3answers
25 views
Sqlite Selecting a value which has maximum id number
I am new for sqlite.
I have a table and 3 columns like
id(int)-name(string)-value(double).
how can i select the value which has maximum id number? (SQLITE)
0
votes
1answer
45 views
Where (or even any kind of join) doesn't work with Temp table in SQLite?
I have to collect data from many sources into a temp table before performing another SELECT on this table and another table. The temp table has a column called RoomID while the table (which I want to ...
0
votes
2answers
63 views
Select count(*) doesn't return rows which have the results of 0 in SQLite?
Here is the sample table:
A | Column1 | Column2
1 5 8
1 3 2
2 6 9
2 ...
0
votes
2answers
38 views
Cast() doesn't work properly in SQLite?
I have a column of image, I want to add a select column (called HasImage) to indicate that if the image is null, the HasImage should have value of false (or bit 0), otherwise the HasImage should have ...
2
votes
4answers
61 views
Detect \n character saved in SQLite table?
I designed a table with a column whose data contains \n character (as the separator, I used this instead of comma or anything else). It must save the \n characters OK because after loading the table ...
0
votes
4answers
48 views
SQLite Database error while trying to retrive values from database
I have an activity in which I am inserting values to a sqlite table, and then querying the table to get the values.
The activity:
public class TableActivity extends Activity {
TableLayout ...
0
votes
2answers
62 views
Select all values in a column into a string in SQLite?
In SQL Server, I can do this with the help of Cursor (to loop through each row in the result set and build my string). But I don't know how to do the same in SQLite, this task is not like the ...
1
vote
2answers
45 views
selecting only 500 rows from table in R
I am using RSQLite package for database operations. For selecting data from table, i used the following code.But i got only 500 rows. Actually this table contains 1200+ rows for that query. What is ...
2
votes
3answers
82 views
SQLite SELECT gives exception How to fix it?
I am developing an android application (using Eclipse and 5554 emulator). When I execute the following code it seems CREATE TABLE and INSERT is working correctly but SELECT has some problem.
Do you ...
0
votes
0answers
40 views
SQLite Prepared Select Statement
I am using SQLite with Adobe Air. My question is can I have a prepared statement that has a param-holder in my SELECT. For instance is this possible ?
INSERT INTO 'tablename' ( firstcol, ...
1
vote
3answers
109 views
SQLite Android select query issues
I am trying to select a country from my countries database and return it to a cursor to be displayed in a TextView. However each time I run this activity my app crashes. Here is my code:
Database ...
0
votes
0answers
26 views
How to properly query SQLite with _-leading columns?
Given the following SQLite query,
SELECT _id, last_name, first_name_pref, title
FROM People
SQLite will return just the _id column.
Two things with this: First, if I move _id further down the ...
0
votes
0answers
19 views
SQLite query for multiple joins, gallery structure
Using SQLite, I wish to output galleries on a site that has the following db structure:
Sets
set_id, group_id, set_title, set_slug, set_description, set_date
Items
item_id, set_id, item_type, ...
0
votes
2answers
47 views
Sqlite: SELECT * BUT id FROM Table
I have many columns in a table and wanted to SELECT * FROM Table except for one column (ex: location) without having to list all the columns I want to use.
SELECT * EXCEPT id FROM Table???
0
votes
2answers
158 views
Sqlite verify if value of column exists
i'm wondering if this method is right to verify if the value of _username already exists in the column "username"
public boolean verification(String _username) throws SQLException{
Cursor c = ...
0
votes
2answers
65 views
Sqlite select distinct with Where
I'm searching through my sqlite database from my android app using the following:
The rows of the database are:
ID - KEY_NUMBER - TYPE
Cursor cursor = db.rawQuery("select DISTINCT "+KEY_NUMBER+" ...
-2
votes
3answers
135 views
SQLite Select query not returning desired value from table [closed]
I have created a database helper class in which I have written a select query like this:
//select statement
public String select(String question_id) {
SQLiteDatabase db = ...
0
votes
1answer
127 views
SQL/sqlite query to union tables with matching columns and merged columns
I'm working with a database that has 2 tables for each company with 4 companies (8 total DBs for thisquery) and for reasons outside of my control that can't be changed. This is also an sqlite DB.
...
-5
votes
1answer
35 views
Need a (simple) SQLite Statement
I have two Tables
FRIENDS
id
friendID
name
prename
FRIENDLIST
id
userID
friendID
I pass a UserID( called myPassedUserID)
I need a SQLite select query. It should lookup all friendIDs in ...
0
votes
1answer
15 views
SQlite “Is not existing in”
I have the following problem. I want to have an Select statement, where I compare 2 ID's and get the ID's who are in Table 1 and NOT in Table 2. This is my last Try.
SELECT * FROM Categories, Stores ...
1
vote
1answer
33 views
SQLite AVG() with LEFT JOIN not returning all rows
I'm having a problem with a rating system.
When there is no matches in the LEFT JOIN it dosnt return the row at all when using AVG().
This is returning NULL if there is no results in join.
SELECT ...
0
votes
2answers
22 views
Combine Table Results in a Relational Database
OK, first-off let me make this clear : I'm very weak with SQL and Databases (I mean apart from several simple statements), but it turns out I have to deal with some SQLite DBs, so I guess I need your ...
3
votes
3answers
104 views
How to add results of two select commands in same query
I currently have two select commands as per below. What I would like to do is to add the results together in the SQL query rather than the variables in code.
select sum(hours) from resource;
select ...
-1
votes
1answer
28 views
how to style sqlite selection
I have the following bill table
building flatname flatdescription amount pastpayments receiptno
1234 name a a 123 0 0
1234 ...
0
votes
1answer
22 views
sqlite selection help needed
I have the following bill table
building name amount payments receiptno
1234 name a 123 0 0
1234 name a 12 10 39
1234 ...
-1
votes
3answers
76 views
sqlite select distinct row that column is greater than another
I have the following bill table
barcode name amount payments
12345 name a 123 0
12346 name a 125 125
12333 name a 133 10
...
0
votes
2answers
80 views
SQLite Select From Where x variable
I'm learning SQLite (with python) and ran into a problem where i got lost.
I made a table:
dat.execute("CREATE TABLE IF NOT EXISTS User_Login(Id INTEGER PRIMARY KEY AUTOINCREMENT, 'User_Name' TEXT ...
0
votes
1answer
122 views
C# SQLite select return empty on a correct statement
I just found a bug in the SQLite.NET library . I have a function which returns an array of strings with the contents of the Select command. The code is as follows:
string selectSQL = "SELECT id, ...
0
votes
1answer
32 views
SQLite Select single colum where two tables match
Hi want to get all entries of a single colum of one table where two colums of two tables match (like join).
So far I sucessfully extract all columns of both tables with the where statement:
SELECT * ...
0
votes
2answers
120 views
searching for symbols in sqlite database
i need to search for and of these ! @ # $ % ^ & * ( ) '\ symbols in within a field content sqlite database, i am using the following sql string
Select ID From Tasks Where '--' || tasks || '--' || ...
0
votes
3answers
229 views
SQLite select all records for today and previous day
I have the following table in my database:
database.execSQL("create table " + TABLE_LOGS + " ("
+ COLUMN_ID + " integer primary key autoincrement,"
+ ...
0
votes
2answers
127 views
Android: Getting row by id
I'm trying to get database row by it's ID, but somehow query doesn't return that row. The sql query SELECT * From Table1 Where _id = 100 works good, so I don't know what's the reason. Here is the code ...
0
votes
3answers
57 views
AND and OR function in one query, not working? sqlite
i run a query with a WHERE
"COMPUTERCLASSROOM_SLOT1 = 0 OR COMPUTERCLASSROOM_SLOT2 = 0 AND COMPUTERCLASSROOM_DONE = 1"
though it return all the row that met a requirement..this is the table rows ...
0
votes
2answers
47 views
How to specify query in sqlite with min() function
I have table defined by code below
CREATE TABLE Products
(
P_Id INTEGER PRIMARY KEY,
name TEXT,
price REAL,
sellPrice REAL,
plu INTEGER,
codeBar TEXT,
tax INTEGER,
amount INTEGER,
date TEXT
);
and ...
0
votes
2answers
96 views
Where clause doesn't work on Android SQLite
I'm new in Android. I'm trying to get a specific word from database (SQLite). But I couldn't make where clause work. Where am I making mistake?
My code is it:
private String[] sutunlar = ...
3
votes
3answers
150 views
Performing just SELECT commands on SQLite
I have made a SQLite database (~700MB, 3 tables, 3 indexes - 1 rtree index and 2 primary keys). I have marked it as a read-only file (on Windows).
Is it safe and performant to execute just SELECT ...
3
votes
1answer
129 views
How to combine two SQLite SELECT statement with two conditions
Here i want to select questions with two different difficulty from same table. I am using query :
readAllQuestions = [NSString stringWithFormat: @"SELECT * FROM tbl_questions WHERE difficulty IN(1,3) ...
0
votes
1answer
124 views
SQLite Multi-column Insert/Replace with Multiple Join
Sorry for the poor title. I have a query (below) that executes properly and creates an insertion just as I would desire. However, I want to make it smarter by only inserting when the exact ...
2
votes
1answer
524 views
Android: load sqlite database content to webview
I have an sqlite database in which I have a content I want to load in webview ,,
as I want to select from database and show in web view,, Is there any way to do so ?
public class TataworatYawmeeh ...
1
vote
3answers
73 views
select list of albums of artist and display for every album tracks count which have requested artist and album in list
I need to make complicated query.
I have table:
CREATE TABLE IF NOT EXISTS tracks
( id INTEGER PRIMARY KEY, path TEXT,
title TEXT, artist TEXT,
album TEXT, genre TEXT,
duration ...
1
vote
1answer
68 views
SQL query to find articles having some properties and missing others
In SQLite, I want to write a SELECT query to find articles, that have certain properties+value or that does NOT have certain properties, where properties are in another table.
This is how I've ...