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
Requirement: We have a Java application that would run on NWCE. This application will be invoked from ERP/SAPGUI via HTML Controller. With SSO enabled, the goal is to pass ERP credentials to CE application. This CE application in turn will use ERP cr [More]
My iPad is not synchronised with my Mac, I use iCloud. How do I transfer an album from iTunes on my Mac that is shared using home sharing to my iPad so that it is also available when I am off line? (similar to synching when plugging the iPad into iTu [More]
I want to disable mail.app.  I don't buy that it's "needed by OS X."  I want it shut off, or preferably uninstalled.  I found a better app that still lets me read newsgroups, and mail.app just gets in the way.  I had to go in and tell Google Cal [More]
Hi gurus, I am working on interface where I need to use a BAPI to create PO, the file can come either from the PC or from the unix server, I think in the below code I have taken care of the file that will be coming through the PC but can you please h [More]
Hi How can One display or populate a message in Java Application, that is generated from a PL/SQL block?Well, the easiest option would be to have a "message" parameter that gets passed back from the PL/SQL block to the calling Java application. [More]
Dear SAP Gurus, I would like to know how can I maintain a forecast that can be consumed by third-party sales order, if there is such standard SAP way to do that. What planning strategy and/or customizing do I need to do? Thanks in advance for your he [More]
I have recently updated my phone to the new 10.2.1.3062 which had 28mb on my Z10, now there is no notification on text messages. messages are just poping through silently. no LED, no Sound. absolutely nothing. on text message icon on homescreen there [More]
Last month I replaced the (failed) hard drive of my 2007 Macbook with a new 500 GB HD. Everything was great until I attempted to upgrade to the latest version of Adobe Flash player for safari. After uninstalling the old flash player I found it imposs [More]
Apparently my battery is in the recall range, but both the serial number of the MacBook Pro (a refurbished one) and the battery are flagged as not recognized. I've checked capitals and O/0s. Anyone else see this?I had the same problem yesterday. Both [More]
I was browsing through the Oracle training courses available in the realm of data integration, specifically FDM's ERPI and was unable to locate anything. Does any such training exist? Or because it is a module/adapter of FDM there is no such specific [More]