Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Logic for Best Matching from possible row...

user481231Dec 14 2010 — edited Dec 17 2010
Hi All,

For example I have below columns and values in my test table

create table test(level1 number,level2 number,level3 number,level4 number,level5 number,level6 number,level7 number,level8 number)

insert into test values(2,3,4,5,6,7,8,9)
insert into test values(12,13,14,15,16,17,18,19)
insert into test values(5,6,7,8,9,11,13,15)
insert into test values(7,8,9,10,11,12,13,14)
insert into test values(9,10,13 ,14,15,16,17,18)
insert into test values(11,22,27,28,29,30,31,32)

select * from test;

2 3 4 5 6 7 8 9 output should be 9
12 13 14 15 16 17 18 19 output should be 12
5 6 7 8 9 11 13 15 output should be 13
7 8 9 10 11 12 13 14 output should be 12
9 10 13 14 15 16 17 18 output should be 13
11 22 27 28 29 30 31 32 output should be 22

when I input a number Ex:12 for each row If there is any column matching exactly it should be dispalyed
IF NOT the most possible highest matching number for that row should be displayed.

is there any in built functions can we use for this ? If anyboyd having this type of logic
please send to me. I think its similar to vlookup in Excel.

Thanks in advance.
Devender
This post has been answered by MichaelS on Dec 15 2010
Jump to Answer

Comments

60437
Leigh - If you can put your application on apex.oracle.com, I will try it there and see what I can figure out. What version of Application Express are you using?

Scott
482478
Scott --

Thank you for the reply...We are currently using version 3.1.1.00.09 on an Oracle 10gR2 database. I will try to post the application to the hosted environment as requested, but it will be the first time I have done so, so be prepared for further questions...or if you guys have a document outlining the how's and "gotcha" that would be good too.

Thanks,
Leigh
482478
Scott --

I'm totally confused now....it usually doesn't take much especially on a Monday morning. I was able to export the three components without errors today. We have been seeing an extraordinarily high load on the system due to other testing and development going on. I'm wondering if the load issue may be related, though I don't see exactly how that could be.

Anyhow, I've attempted to upload my application to the hosted site numerous times now. It is a large application and is timing out during the install. I removed some of the pages and security functions, but it appears I probably removed too much, since I'm getting an Oracle error when installing now.

As the problem is intermittent, even in my environment, I'm going to guess that the issue isn't in APEX, but rather something in my environment.
1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jan 14 2011
Added on Dec 14 2010
10 comments
669 views