Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 281063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:10:17+00:00 2026-05-12T05:10:17+00:00

Hy guys, can anybody please help me with a subquery in Oracle database 10g?

  • 0

Hy guys,

can anybody please help me with a subquery in Oracle database 10g? I need to extract the values for a column in the first table as value of another column in the second table.
I currently use this statement:

SELECT 
CASE WHEN A.column1 = 'A' THEN 'aaa'
WHEN A.column1 = 'B' THEN 'bbb'
.......
WHEN A.column1 = 'X' THEN 'xxx'
ELSE 'bad' END AS COLUMN1, A.* 
FROM TRANSACTION_TABLE A,  CATEGORY_TABLE B 
WHERE A.column1 IS NOT NULL 
AND A.column1 <> ' '

This is not an elegant approach, so I’m trying to use a subselect from CATEGORY_TABLE B like the following:

SELECT A.column1, A.* 
FROM TRANSACTION_TABLE A,  CATEGORY_TABLE B 
WHERE A.column1 IS NOT NULL 
AND A.column1 = B.column_b_1 
AND A.column1 <> ' '
AND A.column1 IN (SELECT B.column_b_1_descr FROM CATEGORY_TABLE B 
WHERE B.FIELDNAME = 'column1' AND A.column1 = B.column_b_1)

So, I cannot get any results by using the subquery and don’t want to continue using the CASE against many conditions, just want to replace the A.column1 values with the descriptive values from B.column_b_1_descr , as they’re easier to read.
I would appreciate any feedback.
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:10:18+00:00Added an answer on May 12, 2026 at 5:10 am

    Unless I’m misunderstanding your question…

    CATEGORY_TABLE:
      name | value
       A      aaa
       B      bbb
       C      ccc
     ...
    
    
    SELECT B.value AS COLUMN1, A.\* 
    FROM TRANSACTION\_TABLE A, CATEGORY\_TABLE B 
    WHERE A.column1 = B.name
    

    or

    SELECT t2.value as COLUMN1, t1.\* 
    FROM TRANSACTION\_TABLE t1 
    INNER JOIN CATEGORY\_TABLE t2 ON t1.column1 = t2.name;
    

    The where clause isn’t needed, since an inner join automatically excludes rows with null values or no matches.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First time stackoverflow user but occasional lurker, hope you guys can help me out.
Hey guys, if anybody can help me out i'd love it... What i have
Hey guys can anybody help me with texture mapping in Direct3D C++. I have
I'm hoping you guys can help me figure out why this is happening. I've
Maybe you guys can help: I have a variable called $bio with bio data.
I hope some of you guys can help me with this problem.... I have
I've run in to a problem I hope you guys can help me with.
I'm really confused so I hope you guys can help me. I know how
I'm learning Ruby right now and I got stuck, maybe you guys can help
Greetings guys, hopefully somebody has fresher eyes and can help me pinpoint the problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.