Sitemap

Amicuk Programming Answers

Select IFF all rows satisfy the condition

-0001-11-30   Views:0

Advertisement

Hi, I am not able to figure out how to go about this requirement of mine. I am using APEX 3.1. I have a table with expiration dates. I would like to select only the company_id, all of whose dates have been expired(to_date(sysdate,'DD-MON-YY') < = to_

Hi,
I am not able to figure out how to go about this requirement of mine. I am using APEX 3.1.
I have a table with expiration dates. I would like to select only the company_id, all of whose dates have been expired(to_date(sysdate,'DD-MON-YY') < = to_date(expiration_date,'DD-MON-YY').
Table:
table_id | company_id | expiration_date
1 | 2 | 10-APR-09
2 | 3 | 10-APR-09
3 | 2 | 10-AUG-10
4 | 1 | 10-APR-09
5 | 1 | 10-APR-09
required output:
table_id | company_id
2 | 3
4 | 1
4 | 1
Thanks,
Medha
Edited by: user11267485 on Aug 18, 2009 11:31 AM
Edited by: user11267485 on Aug 18, 2009 11:32 AM

The replay answer
Advertisement
hI,
user11267485 wrote:
This is the formatted code i am running
select company_id
from table outer
where not exists (
select table_id
from table inner
where inner.company_id = outer.company_id
and inner.expiration_date > sysdate) order by company_idNo it's not: that's unformatted code, exactly the kind of thing you should never ask anyone else to read.
It may have been formatted before you posted it. When posting on this site, type these 6 characters:
(small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing.
This would make your output easier to read, also.
When I run those two queries with the sample data you posted, they both work.  The first one only displays one column, but it's correct.
When you run those queries with the sample data you posted ( *not* with your real table) what results do you get?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Go to See the other 10 answers

Select IFF all rows satisfy the condition

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I am not able to figure out how to go about this requirement of mine. I am using APEX 3.1. I have a table with expiration dates. I would like to select only the company_id, all of whose dates have been expired(to_date(sysdate,'DD-MON-YY') < = to_[More]

Select Single * and Select upto one row

Category:DefaultRelease time:-0001-11-30Views:130

Hi all, Can anybody tell me what is difference between Select single * and select upto one row? And which one is better? Thanks in advance.......According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are[More]

Regarding select single and select upto 1 rows

Category:DefaultRelease time:-0001-11-30Views:130

hi experts,              plz let me know about difference between select single and select upto 1 rows with small eg... thnx in advance.Hi Ravi, According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are[More]

Table Control - Input Enabling/Diabling of Rows based on Condition.

Category:DefaultRelease time:2015-10-11Views:130

Hi, In the TC, I want to Input Enable/Disable the rows based on Conditions. The First row is input enabled always. But the other rows, (2nd onwards) need to be Input Enabled/Disabled based on some conditions. It is possible to make this working. Can[More]

Table Rows with Multiple Conditions Not Showing Up in RH

Category:DefaultRelease time:2015-10-11Views:130

Hi everyone, I'm currently evaluating TCS2 (Framemaker 9 and RoboHelp 8 on Windows XP) and have come across the following issue: One of our FrameMaker source files contains a table in which one of the rows has multiple conditions applied. When one of[More]

Select the current row in read only querry VO

Category:DefaultRelease time:-0001-11-30Views:130

Hi., I am using jdev 11.1.1.5 I had created a Finyear EO with corresponding VO I had also created a read only querry VO [PostdGLhdlnVO] I had created a viewlink between FinyearVO and PostdGlhdlnVO with following conditions FinyearVO.bu = PostdGLhdlnV[More]

Diffrence b/w select single & select upto one row

Category:DefaultRelease time:-0001-11-30Views:130

hi    wat is the diffrence b/w select single & select upto one row? deepakHi, Select single has to be used with a where condition that has all the key fields: It will always return a unique record(If a match is found). Select upto 1 rows would get yo[More]

Difference between select single * & select upto 1 rows

Category:DefaultRelease time:-0001-11-30Views:130

difference between select single * & select upto 1 rowsHi,    According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields. Select single is a construct designed to read[More]

Select Single Vs Select upto 1 row

Category:DefaultRelease time:-0001-11-30Views:130

Hi All, Please tell me which of the two statements is better if we want to retrieve only one record from a table. Select single or Select upto 1 rows? Regards, SaurabhThere is a lot of confusion in the replies and also in the other thread. If yoou as[More]

Select single * & Select  * upto one row

Category:DefaultRelease time:-0001-11-30Views:130

What is the difference between Select single * & Select * upto one row?Performance wise which is a better one?Hi,     According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary k[More]

Selecting from different rows

Category:DefaultRelease time:-0001-11-30Views:130

Hi all, The database is Oracle10g. I want to select one column from one row of a table, based on a condition, and the second column of the second row of that first row of the same table. There should be an order by clause to enable it so that I can t[More]

Hot
Hi Forum, Is there a way to automatically create a Quote or Sales Order from a a Service Call? Regards, Manuel RomanHi Manuel Roman, Service Call is mainly used for after sale support. If you want to have Sales Quote or Order created automatically, y [More]
Hello, Looking for an Invoice Management System expert. I would like to know the following two things. 1. On posting an 'incomming invoice' (with reference to a PO) in SRM this Invoice will be replicated to the R/3 back-end system. The back-end will [More]
Hello, I live in Australia.  Since May 5 after the Security Update 2014-002 ALL my Mac devices (computers, laptop,ipad, iphone) stopped finding ALL yahoo servers. So I can't open ANY yahoo website.  I can receive emails in my mail app but I can't sen [More]
Does anyone know if a Apple ipod phone will pair up with a 2006 Lexus RX330 blue tooth system?My wife has the 2006 RX330 with navigation package. Her phone is the Mororola V-3. I added my iPhone as a second phone and when I select the iPhone as the d [More]
I Photo will not recognize my photos when I try to import them from my camera.  I can download on my work mac but not my personal.  I tried to reformat the card and still nothing.  I can however download them from a CDR.  It's the strangest thing!!  [More]
Dear experts, I want to implement Preventive maintenance for equipments installed in plant area. Requirement is that i should be able to create a maintenance plan & schedul it as per the due dates. Maintenance order should get created. This order can [More]
Hi there, I am sending some bytestreams to a server (via socket) which is able to perform certain tasks, depending on what i am sending. I expect now answers from this server. I guess these answers should be handeled in a separate thread which always [More]
I just downloaded ADE, and everything seems to be working, except that the images are all distorted. You can actually see part of the images below the distortion, but the distortion consists of what appear to be pixelated, thick horizontal lines of v [More]
Why won't a majority of my recently downloaded apps to my IPhone open?Try downloading and installing any free app. That should reset whatever it is that gets awkward.  (This fault often happens after an OS upgrade.)Read other 2 answers [More]
Under file -> preferences in Update Service 2.2.1 I changed my save directory to an E: drive.  The installers fail to run after downloading all the updates.  Works fine when I switch it back to C:, but since it is a SSD space is often limited and I'd [More]