Questions tagged [select-query]
176 questions
0
votes
1 answer
Second selection based on first
I'm trying to make two select queries so that second selection have to based on first. I give first table name "t1" and try to make second selection based on first but finally i get database error.
SQL
SELECT startpoli_i ,
finalpoli_i ,
…

telis
- 35
- 4
0
votes
1 answer
How to perform condition based query using executeQuery() in Swift FMDB
How can i perform below condition based operation in swift FMDB?
let result:FMResultSet=database.executeQuery("select * from image where id = ?", withArgumentsInArray: nil)

Amit Jagesha シ
- 1,092
- 12
- 21
0
votes
3 answers
Take combobox SelectedIndex data and use in SELECT Query - VB.net
I'm a little desperate, hence why I'm here! I'm quite new to programming and have been given an assignment where I need to use a range of SQL queries to generate a simple HTML report table. There is also a user input, with them selecting the…

antisonfire
- 11
- 1
- 4
0
votes
1 answer
How to use result of sql query/queries for another select query?
SELECT *
FROM emp e LEFT OUTER JOIN dep d ON
e.Dno=d.Dno
UNION
SELECT *
FROM emp e RIGHT OUTER JOIN dep d ON
e.Dno=d.Dno
I want to use the result coming from this to another select query. How can I do that?
I only have emp and dep tables.

Madura
- 1
0
votes
1 answer
How to join my tables?
I'm using a Sqlite3 database and I have 3 tables which I want to join. My program basically has documents. And you can select multiple employees that belong to the document. But employees can also belong to other documents.
Below are my…

Remi
- 1,289
- 1
- 18
- 52
0
votes
3 answers
Improve performance of select query in SQL Server database
select
a.COUNTY_FIPS
,COUNT(e.PROPERTY_ID) as house_count
,AVG(cast(e.AVM_FINAL_VALUE as bigint)) as avg_avm
,max(cast(e.AVM_FINAL_VALUE as bigint)) as max_avm
,min(cast(e.AVM_FINAL_VALUE as bigint)) as min_avm
from
…

python
- 4,403
- 13
- 56
- 103
0
votes
1 answer
How I make this kind of Select in MySql?
I have a table and it looks like this,
mysql> select * from match_info;
+---------------+---------+------------+-------------+-----------+
| match_info_id | user_id | body_types | hair_colors | ethnicity…

MCC
- 47
- 1
- 6
0
votes
1 answer
Cassandra Select query
In this table los.configuration is having a partition key consisting of 3 columns (1. groupname 2. class 3.yearofjoining). There may be 2 class BPL and APL. I want to select those two categories from database.
So I have to use the query:
SELECT *…

Praveen
- 11
- 1
- 2
0
votes
2 answers
Difficulty with unusual many to many select query
I've just started to learn MySQL. I've been researching this for a few hours, unfortunately I can't find a solution. I suspect this is pretty easy, I just don't know how to do it. I haven't been able to find a similar situation here or on other…

matimod
- 13
- 6
0
votes
1 answer
SQLServer Select Query Performance issue
I have a performance issue with a select query. The query can take more than 4 minutes which is too long.
This query is launched on .Net Client Process but not on Microsoft SQLServer Management Studio. So It can make sometimes 5 seconds and can…

Andry
- 13
- 3
0
votes
3 answers
How to count and get result of two rows in Mysql Select Query?
This is my table structure.
sometime table1 data my repeat (Ex : Actually Id 1 should have only 4 rows but sometime it is 8 due to duplication) so avoid duplication I use GROUP BY command in select query
Table 1
|id|…

Codesl
- 547
- 2
- 5
- 10
0
votes
3 answers
Select exclude if one row matches
I'm looking for a fast way to search in a table by excluding results in a join.
Two simpelfied tabels:
table 1
- article_id
- term_id
table 2
- article_id
- loc_id
In table 1 there can be multiple rows for the same article_id, it can be linked to…

Tim Hanssen
- 167
- 1
- 1
- 9
0
votes
1 answer
Is it possible for joined tables select query to execute faster than from a single table?
Is it possible for a hypothetic relational database, let's pretend its design shouldn't be semantic or entity-oriented, may result in select query working faster on joined tables than on a single table which holds all the information? I mean, should…

rishat
- 8,206
- 4
- 44
- 69
0
votes
2 answers
sql select query remove rows by comparing dates
I need to write a sql select query on a table, but I have 1 special condition that I have problem with. My table structure is like below:
ID Name Serial CreatedOn
1 A 1000 2014-10-10
2 A …

Erfan Zarger
- 270
- 2
- 7
0
votes
2 answers
selecting rows which contain certain characters
I am working with a product database and i need to select products that are greater than £150 also only entries that have "HP" in the third and forth position of the prod_id.
So far i have tried
SELECT * FROM products WHERE prod_id LIKE 'hp%';
Here…

Jmac88
- 91
- 1
- 3
- 14