473,387 Members | 3,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Several question about select.

Hello,
I want a solutions for a compicateds sql select statments.

The selects can use anything : views, stored procedures, analytic functions,
etc...
(not use materialized view, unless it is neccessary).

question 1)
The selects can use anything : views, stored procedures, analytic functions,
etc...
(not use materialized view, unless it is neccessary).
Suppose I have the folowing select :

select x from t

-- t is a table, and x is numeric column.

The select statement is fixed and cannot be change.
The only change that is allowed is to put a where clause at the end of the
select.

I want that the where clause will influence the result of the select, like
the following.

If I add :
where x = 1
The result will be : 1

If I add :
where x = 2
The result will be : 2

etc..

If I could do something like :
select rownum
from t
where rownum = 1

(the where statement works only for rownum = 1, and then the select return
the value : 1).

The select may use an analitic function etc...
).

If there is any solution for above , I would like to know please + some code
sample.

question 2)

I have a binary tree.
I want to search the tree in some kind of select statement (Left + Parent +
Right).
The output should be the binary search of the tree, each row of the select
return in the right order the search output.

I can use stored procedures, package etc...
but, at the end I want to use one single select statement for that.

How can I do that.
Need code sample, please.

Thanks :)
Jan 25 '06 #1
2 3225
Eitan wrote:
Hello,
I want a solutions for a compicateds sql select statments.

The selects can use anything : views, stored procedures, analytic functions,
etc...
(not use materialized view, unless it is neccessary).


Lets stop right here. First I see you posted this to every usenet group
you could spell. That is not going to make you a single friend and an
apology is appropriate.

Second ... if you can use a Stored Procedure in a query I'd be
fascinated to see you syntax.

I'd suggest following your apology to all you post a single new query
asking for help in the appropriate group, c.d.o.server and actually
explain what it is you are doing (WITH CLARITY) and include your version
number. I'm not going to play guessing games with this.
--
Daniel A. Morgan
http://www.psoug.org
da******@x.washington.edu
(replace x with u to respond)
Jan 26 '06 #2
Eitan wrote:
Hello,
I want a solutions for a compicateds sql select statments.

The selects can use anything : views, stored procedures, analytic functions,
etc...
(not use materialized view, unless it is neccessary).
Lets stop right here. First I see you posted this to every usenet group
you could spell. That is not going to make you a single friend and an
apology is appropriate.

Second ... if you can use a Stored Procedure in a query I'd be
fascinated to see you syntax.

I'd suggest following your apology to all you post a single new query
asking for help in the appropriate group, c.d.o.server and actually
explain what it is you are doing (WITH CLARITY) and include your version
number. I'm not going to play guessing games with this.
--
Daniel A. Morgan
http://www.psoug.org
da******@x.washington.edu
(replace x with u to respond)
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Håkon Helgesen | last post by:
Hello! I am using php to get a result from a MySql Query, but the listing is too long to have in one column. Can i use CSS to get my result in several column? How? PS. This is the very first...
17
by: wolfing1 | last post by:
Like, I know if several checkboxes have the same name, I can get the ones that were checked after submit with a request.form("name") and maybe do a split(request.form("name"),",") to cycle through...
3
by: james | last post by:
Hi, I would like to get all the records from 9 tables that have the same field value in one field (it is a unique field)that is shared by all the tables. Would this method of joining work: ...
3
by: intl04 | last post by:
I was told by an instructor of Oracle SQL that an MS Access database cannot be used to have several people enter records at about the same time, that the database will "freeze up" as a result -...
8
by: Malc | last post by:
Can somebody please tell me whether the following syntax is supported or whether it's a "feature" that will someday stop working. It works in both SQL Server 2000 and 2005 at the moment. declare...
5
by: Chris | last post by:
I have a meetings section I'm developing on our intranet. Using PHP/MySQL. Meeting info and Meeting docs reside on 2 related tables in the db. Users may want to upload anywhere from 1 to 10 or...
1
by: kristof.bonnast | last post by:
Hi all, I'm have a console app which is called by a thirth party system over 20000 times a day. This console app links to a webservice on another server to capture information. This works fine...
3
by: Bob | last post by:
I need to get several recordset for which I'm opening a datareader like so... OleDbCommand rsA = new OleDbCommand("Select * from Authors",cnAccess); OleDbDataReader drA = rsA.ExecuteReader();...
2
by: aeblank | last post by:
THE PROBLEM I'm running into performance issues generating and storing a randomly created graph in a SQL Server database. I have a T-SQL script that generates a graph, and then randomly connects the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.