Questions tagged [select-query]
176 questions
0
votes
2 answers
Get specific value from a comma separated values in Oracle database
I have a table called DUMMY_TAB which has a column COLOR which contains comma separated values as RED,BLUE,WHITE,GREEN,YELLOW. Now i want to check whether multiple colors are present or not and i don't know the order in which values are stored.
I…

Imran
- 429
- 9
- 23
0
votes
1 answer
SQL select query with two tables
I'm struggling with a task. I need to create a select query which:
For each specific listed date shows date and revenue where revenue is number of sold units multiplied with unit price (but ONLY if revenue is greater than or equal to 10 000).
There…

Thomas
- 315
- 1
- 5
- 15
0
votes
1 answer
Prefetchs with Cayenne
I've got an object of the class A in 2 ways relationships with objects of classes B, C and D.
So I could do (with "a" an object of type A):
B b = a.getB();
A a1 = a.getB().getA(); // and a1 would be equal to a
When I do a SelectQuery on A with…

Adrien
- 7
- 5
0
votes
1 answer
Select query is not working. After execution directly going to Finally Block
Here is my code. Connection to database is working. When the statement posts = s.executeQuery(query); is executed it is not even entering into loop and executing from finally. unfortunately there is no exception thrown.
protected void…

Lucky
- 106
- 3
- 9
0
votes
2 answers
Where condition algorithm in SQL Select Query
I am working on task which require me to compare every column of Row. There are a number of ways to achieve, I am curious because number of rows is a big number. So here I am explaining it by…

Ishan Dhingra
- 2,442
- 5
- 31
- 42
0
votes
1 answer
Sqlite Select Query give me wrong result in android?
i want select images and video from sqlite database here i implement my query but it gives me wrong result my current date is 2014-07-15 but it provide me the 2014-07-25 date result which is wrong.
My Query :
SELECT *
FROM myfiles
WHERE ((…

Mahesh
- 1,559
- 6
- 27
- 57
0
votes
1 answer
MySQL query suggestion needed
I have three tables: Orders, OrderAdditionalInfo, Invoices
I need to select (main) orders that has no valid (or uncancelled) invoice.
Fields:
Orders ->
OrderID int(11)
OrderAdditionalInfo ->
DetailID int(11)
OrderID int(11)
Variable…

mustafa öztürk
- 539
- 3
- 13
0
votes
1 answer
MYSQL & PHP calculate total hours in specific date and exclude overlaps hours
I have a MYSQL table for tasks where each task has a date, start time,end time and user_id. I want to calculate total number of hours on specific date.
Table Structure
CREATE TABLE tasks
(`id` int,`user_id` int, `title` varchar(30), `task_date`…

Hadi.M
- 544
- 1
- 6
- 19
0
votes
3 answers
Need help to create a SQL query where clause
I've a table where there are 8 columns and 2 of them are To & From these are having datatype of datetime. I want to execute a select query with some filter on those two fields.
Now see the following example
Record X = From "5 May" to "18 May"…

Krishanu Dey
- 6,326
- 7
- 51
- 69
0
votes
1 answer
How to set Count function field of select query in crystal report detail section?
I want to display rows that contain count() field with group by clause, How can we set programmatically this on crystal report on run time in c#

Ashok
- 157
- 1
- 2
- 14
0
votes
1 answer
Select MAX value from two tables: which one is better
I have two ways to select MAX values from two tables but don't know which one is better or faster.
i checked from mysql workbench but in case both query i'm getting 0.00 Sec execution time
First query
SELECT MAX(s) from (
SELECT sheetid s FROM…

Muhammad Haseeb Khan
- 885
- 9
- 24
0
votes
2 answers
Mysql select query nut running at all
I have the following query:
$query = $this->db->query("SELECT * FROM so.KI WHERE ICCID IN ('$nabi') ") or die(mysql_error());
But I get the following error:
A Database Error Occurred
Error Number:
SELECT * FROM so.KI WHERE ICCID in…

M Reza Saberi
- 7,134
- 9
- 47
- 76
0
votes
3 answers
How to query database if we need to query with an array of id's in jsp?
After selecting some products a user clicked on proceed button. Now I need to display the selected data on next page. I was successful in getting the id's of selected data using the following code.
String[] array =…

Sree
- 51
- 11
0
votes
0 answers
MS Access switch query not ending after first condition is met
I am trying to run a select query in MS Access whose values being evaluated meet more than one criteria (ie: date ranges). The results for the below query include duplicates because the statement keeps evaluating even after the first statement is…

sdmpp5
- 1
- 2
0
votes
2 answers
Getting SELECT to return zero in both cases of NULL and EMPTY row in single SQL query
The following query results value as single row either as value for ExtendedText or zero for matching LineNumber in the table data. I need to add one more condition in the query as - if the LineNumber doesn't exist return one row as zero as same in…

Murali Uppangala
- 884
- 6
- 22
- 49