473,657 Members | 2,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need some guidance on my situation

1 New Member
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.endT ime" is NULL, then display 0

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

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 1597

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

Similar topics

4
2809
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 follows. B is derived from A, and C is derived from B. All the derivations are public.
3
2379
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 (name, address, telephone number) as well as movies in there collection. The movies will be categorized by genre (comedy, romance, horror, etc.) and title. I want to be able to let the users add and remove movies to their list of movies they own,...
5
1587
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 substituted in their place. Other elements may need to be added or deleted altogether. So far I'm not seeing how this can be done in xslt...Looking for some sugestions. Right now I'm doing the transform with XML::XSLT in perl, but could use...
2
1944
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 time (i already have a prog. to produce those random number) what indicates the arrival of a next passenger to bus Q. -arrival: of bus at stop. if no one in Q, bus continues to next stop and event of its arrival is generated. Else,...
2
1790
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 at one point and I need some guidance. I have two tables tblWorkers and tblLocations (locations & positions to volunteer & start and end time) and made relationship using tblJunction. I need to build a form which shows volunteers details and...
8
1910
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 numbers we entered to a..that should be added.. for eg if a = 34 the answe should be 7 that is 3+4 using % and / we can solve this problem..pls help me to get the problems
7
1611
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 data. I have done one. I need guidance in my first steps. Just some one who can have a glance at it and can suggest mistakes that I have done. So that I can correct them and learn. If any one have interest to provide little bit of guidance please...
2
2023
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 " " I would like to be able to print R1P1,R2P1,R3P1..., then do the same thing for each subsequent person.
0
8385
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8303
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8821
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8723
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8502
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8602
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1941
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.