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 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
But, generically speaking, not all DB engines support this construct.
For instance, Firebird only added it just over a y...Query about Queries
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,
...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...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 . . .
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
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...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?
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.
...Query to Save Queries
Save SQL Statements in the Host SQL MENU???
I want to add items to the pencil menu in the Host SQL page. Eg. "Save SQL Query".
Could someone point me in the right direction on how to populate the pencil menus. Thanks in advance.
If your interested read on :
So the idea is to make the currently "empty" pencil menu contain a list of queries, hosts/DnnCommunity can click on & execute, rather than typing them in each time.
''in the page load of admin/portal/sql.ascx.vb ln: 57 I want to add this line of code
If Len(Request.Params(&quo...Exacute query against query
I have a query which selects all dates from my database between 2 date values which is then entered into my dataset. I thin want to run through the dataset totalling the value of a certain column but only if dates match e.g.
27/02/2007 2.10 Tota...Query of Queried data
I am new to asp.net after working with coldfusion. I have created a datagrid from a query of a sql database. I am interested to know how can I create another datagrid which will process a query of the data in the original grid. So essentually it is a query of a query. Thank you
You want to filter on the result of the first query? The easiest way I can think of, is to put the data in a datatable, then use the select and dataview features of the datatable.
Hi,uusquintsYou can filter the datatable in the code-behind and bind the result to the 2nd datagird:...Query and ?sub query??
Hi there,I hope this is the right place to ask this question.I have two Access tables (tblUsers and tblMessages) to use in datagrid. tblMessages has two relations with tblUsers - the UserID field and the SenderID field, both of which are one-to-many relationship. When the user goes to the inbox, the data selected needs to do the following:1) pull out the messages with the UserID that matches the current user id number.2) since it needs to display the username of the person who sent the message, I need to pull out 'username' from tblUsers where it matches the SenderID. Storing the userna...Query and Sub-Queries
I have a SELECT statement that has two sub queries in it. The 'where'
clause in the main query filters a TRADE_DATE field, for example: ......
where TRADE_DT >= '2003/01/01' and TRADE_DT <= '2003/01/31'.
Since I only have one date field(TRADE_DATE), I want the sub-query to query
where TRADE_DT <= '2003/01/31'. But its not working. I have to hard code
the '2003/01/31'. Now I know I can make a dynamic view in VB, but an ideas
of how I can do it in SQL? Here's my statement:
select T.BROKER_SEQ_NO,B.BROKER_NAME,B.B...Query String Query
Hey i have no issues getting a bunch of value out of a datasource based on a query string when the format is like :Default.aspx?id=1I then put the "default.aspx" page in a folder called "profile" and tryed to see if query strings in this format worked : Profile?id=1My new "challenge" is to get it so that the person can have a string value as there id but in this format :Profile/Stringi believe it is doable but i am not sure how. Anyone know / suggestions? thanks Si!
You can use URL Rewriting/Mapping. Brian O'Connell (MCAD) - http://www.sys...query runs fine in Query Analyser but not the Query Debugger
I'm running a query, actually its an insert that works when using the TSQL below.
However when I try to use the debugger to step through and using the exact same values as those below I get the following error:
[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification
Its Killing me because everything else works, but this. Can somebody help.
DECLARE @NoteID INT,-- NULL OUTPUT,
@Note_Description NVARCHAR(3000),-- = NULL,
@Date DateTime,-- = NULL OUTPUT,
@ByWho NVARCHAR(30),-- = NULL,
@FK_Action_Performed NVARCHAR(40),...Query Within A Query?
I have a table that looks kinda like thisTag Info SignOutDate1 Hi 09/03/20051 Hi 09/02/20051 &n...Query a query in linq
Hi, I have some code that gets some results:var GlobalTable = from p as db.table select p; Now I want to run a query in link on the results stored in GlobalTable. Whats the best way to do this? keepin' it real in the ATX.
Exactly the way you ran the first query:
var GlobalTableSubset = from gt as GlobalTable ...Having trouble querying a query?
I'm trying to transition my reports from Access 2000 into Infomaker 7.0 but
I'm having trouble combining two queries together. In Access you had to
option of pulling tables or queries as your data, I don't see this option
in Infomaker, am I missing something. Thanks from a newbie...
IM doesn't have this feature, since it adheres to general Ansi SQL
standards. If you show me the Access query, maybe I can give you a
workaround. Are you querying an Access DB or a different DB, e.g. Oracle?
Terry Dykstra (TeamSybase)
Please state PB / OS / DB versions in your ...Query Plan Query
We have a sql query that is causing a few issues in terms of
performance as the optimisor is choosing to table scan where
an index will certainly yield significant gains. As proven
when snapshotting the query and adding an index hint
Unfortunatley since the query is dynamically created by a
3rd party application, we are unable to influence this with
index hints and are dependant on the optimiser.
The table that is table scanning is partitioned (has also
hust been repartitioned to address a slight inbalance across
partitions) and has 7.6M records. It has been recently
r...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...Load report failed. Submit Query Submit Query Submit Query
Hi,I am trying to upload a crystal report for vb.net with asp.net 2.0 application on windows 2000 server. When i am trying to a access the report page it just displays an error Load Report Failedand follows the mix of Crystal viewer header's buttons and the word "Submit Query" many times. I am trying to solve this issue from last 3/4 days and really tired now and thinking of get rid of crystal report. Can any one please help me on this issue Please note that this report runs fine on my local machine. Thanks
Please paste your Code here and let me know which model y...performing a query within a query
Was wondering (yet again) if there is an easy way of performing a query on another query. For example:
I am displaying areas from one table and towns within that area from another table and the output should look like this:
I was wondering what is the best way to do this. Thanks for any help.
Select AreaInfo,TownInfo FROM Area INNER JOIN town ON Area.AreaID=town.AreaID
ORDER BY AreaInfo,TownInfo
Then you would need to do the formatting in the Web page.Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blo...Getting parameter not found error at Delphi-SQLite query [Edit]
I am getting error like 'parameter not found' with following SQL query at Delphi
In table emp
usergroup_id :- integer
label, description are string data type.
My code is as follows
SQLQuery31 := TSQLQuery.Create(nil);
sdescription := RzEdit1.Text;
ldescription := RzMemo1.Text;
gid := Integer(RzComboBox1.Items.Objects[RzComboBox1.Items.IndexOf(gname)]);
SQLConnection1.Connected := true;...Populate Query from previous query?
I am pretty new to asp.net and need a little help with populating a query statement based off of a previous query statement. In the code below, I need to create another select statement that runs prior to the "picSQL" statement and populates the area that I have the ??? in the WHERE clause. I need to get the "theme" type from another table in the same db before running the SELECT statement below. Can someone please help on how this should be structured?
string picSQL = "SELECT picName, desc1, desc2 FROM media WHERE theme LIKE '?????'";
string conn...Query Effeciency, sub query
is it more efficient to make multiple parameters or to use sub queries, for instance
i have a database of contacts, and i would like to narrow it down to the people who have not been called yet, and then use some other criteria also
would it be best to do a subquery to get the results of the people who have not been called, then off of that sub query run the main query of which state i would like to call?
or is there an even better way that i may not know. i am a beginner of efficiency in SQL, i can run dirty not so efficient queries pretty easy, but i have not gotten to deep into e...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...run a query while looping through a query
I need to query a database and then run a query on each resulting row.When I do this, what all do I need to re-do to run the new SQL query?I am especially worried about not closing my conn and getting non-updated data on my application but am not exactly sure under what conditions this will happen.Thanks,Andrew Here is the code for accessing my database...//Data Accessstring strSQL = "SELECT * FROM Users WHERE email = '" + txtUser.Text + "' AND password = '" + txtPass.Text + "'";string strConn = System.Configuration.ConfigurationManage...