Questions tagged [select-query]
176 questions
3
votes
3 answers
nhibernate intercept select query
I'm looking at the nhibernate interceptor. It seems to be able to intercept save, update and delete queries but is there anyway I can intercept a select query.
The problem I have is that I automatically want to append some additional sql filters to…

mat-mcloughlin
- 6,492
- 12
- 45
- 62
3
votes
4 answers
Select rows where specific field has value more than half of max value of the same field
I'm wonder if there is a way to select rows where an specific field has value more than half of max value of the same field.
For example we have a result set with 3 fields (id, name, rate) that rate is an alias. If max rate is 70 so query should…

Omid
- 4,575
- 9
- 43
- 74
3
votes
2 answers
I need to speed up specific mysql query on large table
Hi I know there is a lot of topics dedicated to query optimizing strategies, but this one is so specific I couldnt find the answer anywhere on the interenet.
I have large table of product in eshop (appx. 180k rows) and the table has 65 columns. Yeah…

user1768510
- 31
- 1
- 1
- 4
2
votes
2 answers
SQL Server 2005 - Counter in a select query
I would like to have a row counter in the select query of my stored procedure, but the counter would not be incremented for each row. The incrementation would depend on the value of one of the fields. Something equivalent to this invalid…

ConnorsFan
- 70,558
- 13
- 122
- 146
2
votes
3 answers
Select Query - WebSQL
I've the following code to select a row.. When I call the function with getRecords("Peter Sam"); one record is shown.. However if I just pass getRecords("Peter"); it says "No results".
getRecords = function(cname){
…

Naveen
- 1,040
- 4
- 15
- 38
2
votes
1 answer
Selecting data from the start of every hour
I have an MS Access database table that populates every minute, and I need to write a query to select the data at the start of every hour. Does anyone how I would go about writing such a query?
BOF_TOTAL EAF_TOTAL EAF BOF …

LaDante Riley
- 521
- 4
- 14
- 26
2
votes
3 answers
Mysql Code To Mark New And Duplicate Values
I have a mysql table (shown below) with some values, I need to get the new values and duplicate values
I tried SELECT *,COUNT(SerialNumber) FROM config_log GROUP BY SerialNumber;
But it return only the duplicate count. How to find this ???
Thank…

JIJOMON K.A
- 1,290
- 3
- 12
- 29
2
votes
1 answer
Perform a simple select query in Firebase Firestore
How can I perform a simple search in Firebase Firestore to check if a record exists in a collection? I've seen this code in the documentation, but it is not complete.
// Create a reference to the cities collection
var citiesRef =…

Sony
- 7,136
- 5
- 45
- 68
2
votes
1 answer
Droped and recreated hive external table, but no data shown
First a hive external table is created:
create external table user_tables.test
(col1 string, col2 string)
partitioned by (date_partition date);
records are inserted:
INSERT INTO TABLE user_tables.test
PARTITION (date_partition='2017-11-16') VALUES…

Ani Menon
- 27,209
- 16
- 105
- 126
2
votes
1 answer
MySql StoredProcedure with inner join
I have a table named region having two columns : having region_id is primary key
|region_id | region_code |
| ----------+-------------+
| 1 | Asia |
| 2 | Can |
| 3 | Cen …
user6705109
2
votes
1 answer
How to compare two fields in QueryBuilder?
I'm using QueryBuilder.
I want to select all record in VendTable having two equal fields.
My code is looklike this:
QueryBuildDataSource qbds;
QueryRun queryRun;
qbds=…

ulisses
- 1,549
- 3
- 37
- 85
2
votes
3 answers
SQL grouping related columns
Suppose I have a table with 2 columns like this:
Person1, Person2
David Jessica
Jessica David
David Oz
Oz David
Guy Richard
Richard Guy
Jessica Oz
Oz Jessica
and another table with 2 columns:
Person Last Posted
David …

mishaniy
- 31
- 8
2
votes
3 answers
How to sort month in a table when retrieving using the sql query?
I have a query which gets month name from a table. But this column isn't a datetime data type, It's a varchar column. How can I sort it according to the month name in ascending order?
This is the output I get at the moment.
August
November
…

Mike
- 1,017
- 4
- 19
- 34
2
votes
4 answers
select count(1) from tablename where column=column
Question from interview:
We have table with name = tablename and some column.
We don't know column type.
SQL request: select count(1) from tablename where column=column
What result does this request return and why?

Vladislav Kysliy
- 3,488
- 3
- 32
- 44
2
votes
1 answer
MySQL How can I make a better query to connect two tables through my bridge table?
I have these tables:
words:
+----+------+
| ID | DATA |
+----+------+
| 1 | jo |
| 2 | yes |
| 3 | jupp |
| 4 | yeah |
| 5 | jepp |
| 6 | joah |
| 7 | ne |
| 8 | nee |
| 9 | no |
| 10 | nope |
| 11 | nah …

gaugau
- 765
- 1
- 9
- 30