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, I have updated IOS6 yesterday, It was amaizing but I have lost Maps. Earlier it was very easy to access on Maps as a GPS device. I was very much happy with iPhone 4S as it was working with Maps very fast and was able to provide me correct route b [More]
I have had success managing LAN clients via ARD, but now my situation is different. I want to still be able to provide ARD support via a network address specific to a workstation from outside the LAN, and the IP address I have tried does not connect. [More]
Hi, I have a table with 3 columns. Column 3 is a detail record with column 1 being the parent. Column 3 is displayed in the table using af:iterator #{row.detailRows}. The detail records are created in a different page. When I add the detail records t [More]
hello, I am having problems while installing Oracle 8i personal edition under win98se. I am stuck on the creation of database. it always stuck at 85%. I've try installed many many times.. but it still the same.. what can i do? i am using win98 se. is [More]
Hi DBAs, I need to migrate the EBS (11.5.10.2) on 4 middle tier servers with single node database (10.2.0.4) running on Solaris 10 to Redhat 5.4 platform. The DB on redhat will be Cluster database with 4 nodes and PCP enabled. As it is a cross platfo [More]
I have this error message: How do I fix it?? Thank you! Dear developer, We have discovered one or more issues with your recent delivery for "Your Awesome App". To process your delivery, the following issues must be corrected: Invalid Signature - [More]
I do not know to start for installing the cisco packet tracer on mac os x. please teach me. I need to use packet tracer for my styding in the class roomHi download " PlayOnMac " Application ==> http://www.playonmac.com/en  and  then install & [More]
Hi there ! how to save applet in image (gif/jpeg) format. i have just gone through JIMI package where serilization is there ,WHERE U CAN SORE in image format ...........can anybudy help me out.........if possible then pleeez provide me some example. [More]
I am trying to write a script that searches for image tags and checks for alt tags within them. I am using preg_match_all to find all the img tags but i am messing up somewhere on my regular expression pattern. I seriously just started learning these [More]
Dear Experts, I have configured my saprouter and its working fine (as from test niping). Now i am trying to logon to the OSS of sabserv7, It desplyes first message "Unable to connect to the SAPNet message server, default connection will be use" [More]