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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 247k
  • Answers 247k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer DotNetOpenAuth doesn't set or support Except100Continue directly. Would be nice… May 13, 2026 at 8:38 am
  • Editorial Team
    Editorial Team added an answer This is exactly as specified. Type patterns consist of types,… May 13, 2026 at 8:38 am
  • Editorial Team
    Editorial Team added an answer So I'm wondering if there is a Java library that… May 13, 2026 at 8:38 am

Related Questions

Hy guys, my question is: if i have in asp.net, a SqlDatasource or AccessDatasource
Hy guys. I've created a simple blog app with the usual CRUD actions. I've
Hy guys, i have a postgresql 8.3 server with many database. Actually, im planning
Hy, does anyone worked with N2 Content Management System( http://www.codeplex.com/n2 ). If yes, how

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.