Questions tagged [select-query]

176 questions
0
votes
1 answer

No such column error while compling select statement in SQLite in android

/Database creation Code/ public static final String QUESTION_TABLE_NAME = "mythquizq"; public static final String QUESTION_COLUMN_ID = "_id"; public static final String QUESTION_COLUMN_MYTHQUIZ = "question"; public static final String…
user2859719
  • 9
  • 1
  • 2
0
votes
3 answers

MS Access SQL Select Statement Returns Correct Fields but No Data in the Rows

I have two Microsoft Access database tables. They are named Historical_Stock_Prices and Balance_Sheets. I need to combine data from each of these tables to create a table called Daily. I need to take the fields Ticker, [Date], and [Close] from…
gromit1
  • 577
  • 2
  • 14
  • 36
0
votes
3 answers

MS Access SQL Select Statement from Two Tables

I have two Microsoft Access database tables. They are named Historical_Stock_Prices and Balance_Sheets. I need to combine data from each of these tables to create a table called Daily. I need to take the fields Ticker, [Date], and [Close] from…
gromit1
  • 577
  • 2
  • 14
  • 36
0
votes
1 answer

SQL query to select mapping table values?

I have a table named Patient in which I have columns like ID Disease1 Disease2 Disease3 ---------- 1 4 3 2 ---------- 2 2 5 ---------- 3 6 ---------- 4 1 These are…
user1015347
  • 41
  • 2
  • 6
0
votes
2 answers

SQL SELECT Query based on yes or no questions

I have two question sets. One is Yes or No questions. Based on this question's answers I need to display another set of questions. For this I have added a question code for Yes or No questions. and for the second set questions given these question…
DixonMD
  • 93
  • 1
  • 11
0
votes
1 answer

Select Query giving error in sql server R 2?

I have a database called Inspection, and a table called User. I first try to query it as follows: select * from User ; ... and then like this: select * from Inspection.dbo.User ; Both of these are throwing the following error: Incorrect syntax…
tester Joe
  • 73
  • 2
  • 5
  • 15
0
votes
3 answers

MySQL select group by having column != x

I'm trying to select rows where a certain column does not have a certain value, such as 0, but I'm unable to get this to work. SELECT * FROM rentals GROUP BY date, rooms, price HAVING show_independently < 1 If show_independently is 1, then I don't…
Davicus
  • 428
  • 4
  • 15
0
votes
2 answers

Select query in SQLite?

I'm making use of the function to retrieve one value from the table, public ArrayList selectValue(SQLiteDatabase sqliteDB, String contactEmail){ Cursor c = sqliteDB.rawQuery("SELECT * FROM " + TABLE_NAME + " WHERE…
Naveen
  • 1,040
  • 4
  • 15
  • 38
0
votes
3 answers

How to make value in ascending order in the mysql?

I want this type of output to fetch task_name from database like in this format Task 10 Task 2 Task 3 Task 5........ My Query is SELECT task_name, section_name, ref_student_id FROM scores WHERE ref_student_id = '".$studentid."' AND…
Nishant Patel
  • 335
  • 1
  • 5
  • 23
-1
votes
2 answers

How to check multiple condition for same field in my SQL?

Following table: ECNO BRANCH MONTH ISDELETED 1 B1 February 2018 n 2 B3 February 2018 n 3 B3 March 2018 n 4 B1 March 2018 n 5 B2 January 2018 n 6 B3 January 2018 n Here we need to select according to…
Rajaram1991
  • 95
  • 1
  • 10
-1
votes
5 answers

Combine 2 Columns in One Column

hi I have two separate columns [StuName , StuLName] in select i use like this : Select StuName, StuLName From Tbl_Student Result : [Mahdi], [Hosseini] is there any way to combine this 2 columns in one column (only in select) something like this…
user7647348
-1
votes
0 answers

How to apply trim function inside this query

Below is simple sql query to select records using in condition. --like this I have 600 usernames select * from tblUsers where Username in ('abc ','xyz ',' pqr ',' mnop ' ); I know there are LTrim & Rtrim in sql to remove the leading trailing…
Kgn-web
  • 7,047
  • 24
  • 95
  • 161
-1
votes
1 answer

Check if row exists from select count(*),where MS SQL query (asp.net)

i just want to set a variable based on if qno field row is empty or not i.e any entry has been inserted earlier or not c# code: cmd2 = new SqlCommand("Select COUNT(*) FROM " + tname + "WHERE qno = @qno", con99); …
Jai hind
  • 85
  • 1
  • 11
-1
votes
4 answers

Print UPDATE statement for a row based on select results?

I have a scenario where there is Prod/Test and in the Test environment, I have a settings table (row) with many columns that I'd like to be able to run an UPDATE after a database refresh and set everything back. This select would return a row of…
William YK
  • 1,025
  • 12
  • 26
-1
votes
2 answers

How to get highest matching records first of select query mysql

Please do not down rate my question, because i'm new to MySQL. My Question is; I have a table named 'item', and it has 'id', 'timestamp', 'title' columns. consider the table has following records in above order(id, timestamp, title). 100, 2016-01-12…
Indunil Girihagama
  • 415
  • 1
  • 7
  • 11
1 2 3
11
12