473,385 Members | 2,069 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,385 software developers and data experts.

Need some guidance on my situation

Hi all, Im an Oracle newbie here. I have questions here that need guidance from Oracle Expert here. Here it goes:

- there are 3 databases that will be used: tableA (2000 records), tableAsub (45000 records), and tableBsub (850000 records)

- relationship between the 3 tables: "tableA" --link to--> "tableAsub" --link to--> "tableBsub"

- get the minimum "seq" from tableBsub

- get the first "startTime" and last "endTime" from tableBsub, group by an id

- if tableAsub's status is "1" and/or "2", then "period" is based on tableBsub's same id, the last "endTime" will minus with the first "startTime" of tableBsub, and if "tableBsub.endTime" is NULL, then display 0

- if tableAsub's status is "3" to "6", then "period" = sysdate - tableBsub.startTime

Just want to ask experts here can this be done in ONE sql statement using case? Or must use pl/sql's if else and cursor? But my main problem is I'm still fresh and it will take me long time before I'm able to understand Oracle's pl/sql.

Then are there any suggestions to improve the performance of the query? Cause I've done some queries on other situations but they took very long to execute.

Thanks in advance.

ps: Please forgive me for me poor English, do let me know if I do not state my situation clear enough and I'll try to edit it.
Jul 6 '06 #1
0 1585

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Warwick | last post by:
Hi I could use some help with inheritance and destructors. I have been following an example in a book and the example has lead to a situation which I have reduced to a contrived example that...
3
by: new_GUY | last post by:
I have a HUGE project (at least for me) and need some guidance. I am trying to create a database for a local university movie club that allows users to input there basic personal information...
5
by: inetquestion | last post by:
I've got an xml doc which I'm using xslt to create a flat text configuration file. I need to make some dynamic changes in certain circumstances where some of the elements need to have others...
2
by: csman24 | last post by:
I'm just looking for some guidance so that I get a start on a school project. Need to write 3 kind of event for a Bus, Passenger, transit system in which: -person: arrives at bus Q after random...
2
by: VirtualLilac | last post by:
Hi, Am trying to build a database for non-profit organisation, its a volunteer job and nobody around to guide me. From my learning I could able to build few reports and forms but am feeling stuck...
8
by: SanjaiGandhi | last post by:
Hi ...i am new to programing....pls help to overcome this program.. The Program is..: if a = 557..using for loop or while or dowhile ..we have to get the answer for 5+5+7..that is what ever...
7
by: yaragallamurali | last post by:
Hi I have thought about my earlier post, refined it and reposting it. I am actually new to schema designing. I have read few articles about data modeling and started building schemas for real time...
2
by: JM420A | last post by:
I have 3 reports that I need to print sequentially, situation is this R- Report P-Person R1 has 3 pages, one for each P R2 " " R3 " ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.