Home » SQL & PL/SQL » SQL & PL/SQL » SQL Query (10.2.0.3.0)
SQL Query [message #402524] Mon, 11 May 2009 05:29 Go to next message
user71408
Messages: 585
Registered: November 2007
Location: NE
Senior Member

Hi All ,

Please find the following requirement and let me know how to write a query for this .

Requirement :

IF SOURCE.uc_type_df, cral_type and specific_code_ind in ( FACT_FORWARD Filter ) i.e.
LCF 6 11; LCF 4 21; MSC 2 57; MSC 2 58;
MSC 6 59; MSC 6 72; RCP 2 4; RCP 2 34;
RCP 2 64; RCP 6 7; RCP 6 71; VP2 2 20; VP2 6 20 then DIM_CONTRACT_NR should be populated as "-3"

Eg : in the above eg : LCF 6 11 here LCF is uc_type
6 is cral_type
11 is Specific_code_ind

Thank you,
Re: SQL Query [message #402525 is a reply to message #402524] Mon, 11 May 2009 05:35 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Depends (as usual) on a lot of things you (as usual) don't tell us.
Re: SQL Query [message #402526 is a reply to message #402524] Mon, 11 May 2009 05:37 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Even if it is confidential you have to decrypt your message before posting it if you want us to help you.
Please find in the following link the description of dbms_crypto package.

Regards
Michel
Re: SQL Query [message #402529 is a reply to message #402524] Mon, 11 May 2009 06:35 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Try this:
RLT 22: Rc
RWQ3 - 22 : aAA
MSC ? 21 !


Hope this helps
Re: SQL Query [message #402531 is a reply to message #402524] Mon, 11 May 2009 06:42 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Please read your post, and try to see it how we do - as a barely comprehensible mish-mash of terminology and requirements.

Fortunately for you, I'm bored, so I bothered to extract what you want from the post, but it's the last time I'm doing that for you.

create table test_195 (uc_type_df  varchar2(3), cral_type number, specific_code_ind number);

insert into test_195 values ('RCP', 2 ,34);
insert into test_195 values ('RCP', 3 ,34);

select uc_type_df
      ,cral_type
      ,specific_code_ind
      ,case when (uc_type_df, cral_type, specific_code_ind) in (
('LCF', 6, 11),
('LCF', 4, 21),
('MSC', 2, 57),
('MSC', 2, 58),
('MSC', 6, 59),
('MSC', 6, 72),
('RCP', 2, 4),
('RCP', 2, 34),
('RCP', 2, 64),
('RCP', 6, 7),
('RCP', 6, 71),
('VP2', 2, 20),
('VP2', 6, 20)) then 1 else 0 end res
from test_195;
Re: SQL Query [message #402552 is a reply to message #402524] Mon, 11 May 2009 07:58 Go to previous message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
user71408 wrote on Mon, 11 May 2009 06:29

Requirement :

IF SOURCE.uc_type_df, cral_type and specific_code_ind in ( FACT_FORWARD Filter ) i.e.
LCF 6 11; LCF 4 21; MSC 2 57; MSC 2 58;
MSC 6 59; MSC 6 72; RCP 2 4; RCP 2 34;
RCP 2 64; RCP 6 7; RCP 6 71; VP2 2 20; VP2 6 20 then DIM_CONTRACT_NR should be populated as "-3"

Eg : in the above eg : LCF 6 11 here LCF is uc_type
6 is cral_type
11 is Specific_code_ind



I anxiously await your next incomprehensible comedy routine.
Previous Topic: Materialized view creation.
Next Topic: Half the query using index and remaining not.
Goto Forum:
  


Current Time: Sun Dec 04 10:46:47 CST 2016

Total time taken to generate the page: 0.08689 seconds