The nested-query tag has no wiki summary.
1
vote
3answers
45 views
Complex SQL Query - nested query
Here is the job_form table...
job_num | name | address |
---------+------+---------+
1 | Tom | Smith |
2 | John | Doe |
3 | Max | Smith |
Here is the individual_job ...
0
votes
2answers
57 views
SQL Server Nested Query Issue
I am currently trying to use a nested subquery to filter rows at each layer of the nested loop. The reason I am doing this is because the queries are made by the user at application level and the ...
0
votes
1answer
187 views
how to write nested query
I have a table named Options. have Three fields Caption, OptionID, ParentOptionID.
it contains some records like :
OptiondID Caption ParentOptionID
1 Entry 0
...
0
votes
2answers
309 views
Nested query not working as expected
I'm experimenting with ElasticSearch. I'm having problems with querying nested objects.
My mapping:
curl -X GET http://localhost:9200/testt/resource/_mapping?pretty
{
"resource": {
...
1
vote
1answer
112 views
Nested Count query
I need some help for a query that outputs something like this:
CityName
CITY A
CITY B
CITY C
CITY A
CITY A
CITY A
CITY C
From this example, the count of each city is: CITY A = 4 , CITY B =1 , CITY ...
2
votes
1answer
183 views
Nested query as PostGIS function parameter
I have a PostGIS query where I really need to have nested queries inside PostGIS function calls:
UPDATE raw.geocoding
SET the_geom = ST_Centroid(
ST_Collect(
SELECT the_geom
FROM ...
0
votes
2answers
169 views
Solr: How to pass a multivalued request parameter as a “local parameter” in a nested query?
I am constructing a nested Solr DisMax query of the format: _query_:"{!edismax qf=...}.... Now I need to add several boosting queries (bq-parameter), but simply writing _query_:"{!edismax qf=... ...
2
votes
2answers
226 views
MySQL/PHP: Using multiple sub-queries in a query selecing multiple results, is it a bad idea?
Sorry if the title is a little... Crappy. Basically I'm writing a small forum and using multiple sub-queries to select the number of threads, number of posts, and the date of the last post in a forum ...
0
votes
1answer
48 views
Using joins rather than subqueries
I have a mysql database containing two tables - [PM_text] and [PM_bact], among others. The two tables contain one common data column. My intention is to retrieve information from the first table using ...
0
votes
1answer
257 views
SQLite ORDER BY result of nested query
I have a table with multiple date fields, and I would like to select the rows with the dates closest to the current date, regardless of which column it is.
There are 2 tables in the database;
...
0
votes
4answers
318 views
PHP assign result from nested query into array
I need help in order to assign the results of a nested query into array. This is the scenario:
$Date_Collection = mysql_query("SELECT DISTINCT Date FROM TblDate");
while($date = ...
1
vote
2answers
208 views
MySQL complex nested query creating a view
I would like to create a view from a table like this:
Configuration | Size | Runtime
0 | 10 | 32.5
1 | 10 | 30.8
2 | 10 | 40.1
...
0
votes
3answers
140 views
Linq Nested Inner Joins
I want to join the following Tables
1. B_Book[1st Table]
-B_BID (Book ID)(PK)
-B_Name
-B_CategroyID (FK)
2. BI_BookInstance [2nd Table]
-BI_IID(Instance ID)
-BI_BID (FK)
...
0
votes
2answers
86 views
nested query & transaction
Update #1: query gives me syntax error on Left Join line (running the query within the left join independently works perfectly though)
SELECT b1.company_id, ((sum(b1.credit)-sum(b1.debit)) as ...
2
votes
4answers
135 views
SQL Nested Query Homework SQL Fiddle
Find Insurance Company with the maximal number of members (patients).
Thats the Database and my first attempt to get closer :
http://sqlfiddle.com/#!3/4b2ed/27
SELECT P.cid AS cid, COUNT ( P.pid ) ...
4
votes
1answer
180 views
SQL Nested Query Homework
Given :
InsuranceCompanies (cid, name, phone, address)
Doctors (did, name, specialty, address, phone, age, cid)
Patients (pid, name, address, phone, age, gender, cid)
Visits (vid, did, pid, ...
0
votes
2answers
225 views
Query runs on DB but throws exception in java
I'm having some trouble executing a nested sql query. It works fine when i run it on TOAD (for Oracle DB) but when I try and execute the same query from my java program it gives me an error : ...
2
votes
2answers
115 views
I'm trying to next statements using sql select & vb .net
I've done something like this in pvp using while loop but I don't think that is valid for vb. I have a total of 4 tables and 3 of them are based off of 1.
Main Table:
weather
Sub Tables:
...
2
votes
1answer
415 views
How to get a nested sub-query to recognize parent query column
I have a problem where I'm trying to calculate a sum of values per given id. I decided to do this using sub-queries (typically I'd use a join, but I'm also keeping a counter for each sub-query for ...
8
votes
2answers
20k views
CAML query with nested AND's and OR's for multiple fields
I am working on proof-of-concept code to dynamically generate CAML based on keywords provided to a highly-specific search web service that I am writing. I am not using the SharePoint-provided search ...
1
vote
5answers
136 views
Is there a way to remove the nested query in this type of SQL SELECT?
Given this table structure and example data (t3 should not be used in the query, it is only here to show the relation between t1 and t2):
t1 t2 t3
...
3
votes
1answer
3k views
Query a nested array in MongoDb
I would like to retrieve documents by the presence of an string in a nested array. For example, the data (representing a dependency parse of a sentence) looks like:
{'tuples': [['xcomp', 'multiply', ...
0
votes
2answers
1k views
When do I use a nested query for postgres sql?
whats the difference between..
select a.value1
from apple a, banana b, oranges o
where a.value1 = b.value1 and o.value1 = a.value1 and o.value2 = 'oranges';
compared to
select a.value1
from apple a
...
1
vote
1answer
98 views
Why can't I select from my query?
I have a query something like this (no, my tables and fields are not called by these names, but the structure is the same) -
SELECT table1.id, table2.id, table1.phone1
FROM table1 LEFT OUTER JOIN
...
0
votes
2answers
164 views
Show names of suppliers who delivered largest delivery (nested query)?
I have a table S containing suppliers (S, SNAME, CITY), a table P containing products (P, PNAME, COLOUR, WEIGHT, PRICE) and a table SP containing deliveries (S, P, QTY) where S and P are foreign keys ...
0
votes
2answers
241 views
same table, 1 field to 2 field query
I have 2 tables: 1st holds employees (of ones in any position) and the 2nd holds manager employee relations with id numbers.
I want to write a query like
1st field: name(employee),
2nd field: ...
2
votes
4answers
234 views
SQL: Help with a nested queries
Here is my schema:
Suppliers(sid: integer, sname: string, address string)
Parts(pid: integer, pname: string, color: string)
Catalog(sid: integer, pid: integer, cost: real)
bold indicates primary ...
1
vote
2answers
818 views
How to avoid nested SQL query in this case?
I have an SQL question, related to this and this question (but different). Basically I want to know how I can avoid a nested query.
Let's say I have a huge table of jobs (jobs) executed by a company ...
1
vote
1answer
2k views
Nested LINQ query using Contains with a bigint
This is the SQL I want (ClearinghouseKey is a bigint):
select *
from ConsOutput O
where O.ClearinghouseKey IN (
select distinct P.clearinghouseKey
from Project P
Inner join LandUseInProject L ...