Querying a Queried result...

Hi, is there such a thing as querying a queried result?

Example, query 1 produces Result A. Result A's table is stored 'somewhere' to be queried by query 2 which produces Result B
If there is, could you kindly direct me to a website with the appropiate article on this topic?

Thanks,
-Gabian-
0
Gabian
1/28/2005 7:17:48 PM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

2 Replies
1195 Views

Similar Articles

[PageSpeed] 38

Yes there is, querying a View is querying a query rewrite.  Send me an email the address is in my profile I will send you a Views tutorial I wrote a while back and run a search for query results from View in your BOL(books online) for code samples.  Hope this helps.

Kind regards,
Gift Peddie
Kind regards,
Gift Peddie
0
Caddre
1/28/2005 7:26:36 PM
You can use a derived table:
SELECT *

FROM
(
SELECT <cols>
FROM <table>
) d
0
ehorn
1/28/2005 7:36:02 PM
Reply:

Similar Artilces:

Combine SQL query result with XML query result
Hi all, Hopefully someone can help me with this: I know how to setup and run a query on an SQL db and I can probably work out how to query an XML file, but how do I take the results of each and combine them into one collection (i'm presuming a dataset)? Once i've created the combined collection, i'd want to order it by some universal identifier present in both datasources e.g. product ID. It's worth pointing out that the XML file would not be in the same format/use the same field names (or number of fields) as the SQL query, so I guess I might need to bind my query resu...

Novice DBA looking for Advice on Querying the result of a query of a results of a query of a....
Many thanks in advance! Here's an example of what I'm working on.  Let's say I have a row of data that is returned in a query.  The columns are First, Middle, and last.  We'll say the values in each column, respectively, are 1, 2, and 3. So I run my first query, something akin to SELECT MIDDLE WHERE MIDDLE = 2.  And we get that row.  Excellent. What I'm trying to do, is after that statement is executed, run another one on the webpage that looks like SELECT LAST WHERE LAST = [the value that was returned in the previous statment]. And the k...

C# Ado.net Sql query parameter query
Hi All, I'm trying to pass in a parameter value from an array in a loop that is used in a sql query and the results are populated to an xml file. The trouble is that I'm only getting the colums values in the outputted xml file. So I feel that the paramter is not being read. So can anyone help as I'm really stuck on this one. The code is as follows : public void DisplayUserInfo() { ArrayList UserIdArrayList = IdentifyUserID(); foreach(string ShowUserIDString in UserIdArrayList) { try { SqlConnection SqlConn = new SqlConnection(DBConnString)...

can i do an sql query then use the result of that in another query...
for instance i need to find value of storyId from one table then make sure i do not pull that record from another table. is this possible With SQL you can do something like this: select * from TableB where StoryIdValue not in (select StoryIdValue from TableA) This is just 1 of many possible solutions. ChrisDont forget to click "Mark as Answer" on the post that helped you.This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped. Yes this is possible. This is what is called a "Nested Query" in SQL. ...

How to Query A Query
I have been trying to build a crosstab report that reports everydate within a selected range across the top and specific row information. 7/1 7/2 7/3 . . . Name Detail1 Detail2 Detail3 Name Detail1 What I get as output is only the dates that contain information in the rows. I can get the information I need by using a query within a query (nested). Can a nested query be done in Informaker 5? What about version 6 or 7? Thanks for your help Convert your SQL to syntax, and you can write anything you want. So if your DB support...

How to query a query...
I'm working on converting an Access DB that I created into an ASP.NET application (and attempting to learn ASP at the same time...). One of my queries was very complex and required running a different query first, and then working off of that one. Any suggestions on the best way to do this in ASP? The following is a sample of code I'm using so you can see the type of data-binding I'm using. Thanks for the help! myConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " +"Data Source=" + Server.MapPath("/EquipmentCheckout.mdb")) strS...

Easy SQL question. How to display query results in Query Analyzer
When I run the following query from Query Analyzer in SQL Serer 2005, I get a message back that says. Command(s) completed successfully. What I really need it to do is to display the results of the query. Does anyone know how to do this? declare     @SniierId as   uniqueidentifierset @SniierId = '85555560-AD5D-430C-9B97-FB0AC3C7DA1F'declare    @SniierAlias  as nvarchar(50)declare    @AlwaysShowEditButton  as bitdeclare     @SniierName  as  nvarchar (128)/* Check access for Snii...

Can sql queries be nested in sql queries?
I am having problems with a template that uses the information from one sql query to generate a query on another table. Let me be more specific. The template in question receives a category ID value from a web page that provides a menu of several categories to choose from. Each Category ID represents several Items or products to choose from. When the template receives the category ID, the first thing it does is run a query on my item_category table (this table lists all of the items and associates them with the appropriate category). This query returns several itemIDs that are all...

Query about Queries
Hello all, As a relatively new user to Sybase I am hoping someone can point me in the right direction. We are getting ready to go live with our database and I am wondering what types of queries I should be running for system performance purposes. If anyone has any suggestions they would be more than appreciated. Thanks in advance, Jerry ...

Query a Query
I have a result set in a query. Is it possible to query this query? (no specific SQL dialect, can it be done generically?) Petros -- PETROS GAVRIELIDES wrote: > I have a result set in a query. > Is it possible to query this query? > > (no specific SQL dialect, can it be done generically?) There is a generic answer to your question: Yes, there is a construct called a sub-query that allows you, in 1 SQL statement, to query from a query. But, generically speaking, not all DB engines support this construct. For instance, Firebird only added it just over a y...

VB .NET Dataset SQL query results
Hi, I'm hoping someone can shed some light on how I can address variables returned to a dataset via a stored procedure.I've coded an AJAX Autocomplete control but due to the restriction of the control (only being able to return one value) I now need to use the returned value to search my DB.  The stored procedure used for the Autocomplete returns the key information (and the description).  I'm assuming the key info is stored within the dataset. So my question is, how do I read the key information into a variable for use elsewhere?Stored proc Select Statement; SELECT SU...

If one query returns any result then the result from other query should be eliminated..
HI, I want to create a query which returns allowed reports for the user. There are two different queries which returns the allowed reports. One returns the reports according to user and other reutrns reports according to the role of user. e.g.Select ReportID from UserReports and  select ReportID from RoleReports (in original scenario both queries are quite complex and large) Requirement is if the first query returns any row then the result of the from the second query should be ignored. IF(Select ReportID from UserReports > 0) Begin Select ReportID from Us...

Query a Query with multiple results
Hi,New to .Net and SQL.  I have two tables that I have joined together.  RentalControl_Main has the rental informationd and an Adjuster ID that links to the ADjuster table and the adjusters name.  I am trying to create a report that gives the "Single" adjuster name and the totals for all of their contracts.  I have a details report that gives each contract info. for each specific adjusters rentals.  However, I want to just list the adjuster once and give all of their totals.  In my SQL statement I have all of it written out and just need to knowwhat to do in pla...

vb.net code dependent on sql query results
Hi, I was wondering if someone can help. My apolgies if this is posted to the wrong forum. I am trying to do some vb.net code around the results of excecuting a sql query. The sql query compares entries for a project budget and items invoiced (actuals) for a specific project task (the sql join is on the TaskId). When executed it returns either one or many records. Each record has the following info (in fields): a budget rate (e.g €1000), budget qty (e.g 2 man days), budget total (budget qty x budgetrate), task ida actual rate, actual qtry, actual total (actual qty x actual rate...

Web resources about - Querying a Queried result... - asp.net.sql-datasource

Wanderers coach Tony Popovic slams Sydney FC's Graham Arnold for querying players' integrity
Western Sydney coach Tony Popovic has lashed out at Sydney FC coach Graham Arnold for suggesting Wanderers players celebrated Ali Abbas' injury ...

BBC News - Querying Nato's rapid reaction force
Nato's announcement of a beefed-up rapid reaction force raises big questions for many of its key member states, says the BBC's Jonathan Marcus. ...

Querying EntityFramework Views without a Key
By definition an Entity should have an Identity. An issue that often comes up with EF is querying views which do not have a primary key. No key, ...

Facebook unveils Presto engine for querying 250 PB data warehouse
At a conference for developers at Facebook headquarters on Thursday, engineers working for the social networking giant revealed that it’s using ...

Manually assigning .related('somerelation') without querying database? · Issue #919 · tgriesser/bookshelf ...
bookshelf - A simple Node.js ORM for PostgreSQL, MySQL and SQLite3 built on top of Knex.js

Cloudera Impala Brings SQL Querying To Hadoop
Cloudera's SQL-on-Hadoop tool hits general release, but will it satisfy demands for faster, easier exploration of big data?

Pivotal juices Hadoop with in-memory database and SQL querying
Pivotal, an EMC/VMware spin-off that has big plans to deliver big data analytics through platform as a service, has whisked the

Link Building Query Theory: 7 Crucial Keyword Types for Link Prospect Querying
These seven common types of prospect keywords will expand how you think about link prospecting and help you become a smarter, more strategically ...

Microsoft updates Power BI for Office 365 with data search, natural language querying, and 3D visualizations ...
Emil Protalinski / The Next Web : Microsoft updates Power BI for Office 365 with data search, natural language querying, and 3D visualizations ...

MH370 report reveals 17-minute delay in querying missing plane
Air traffic controllers took four hours to launch search and rescue operation, according to files released by Malaysian government

Resources last updated: 12/12/2015 3:03:55 PM