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 8222709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:22:17+00:00 2026-06-07T14:22:17+00:00

I just want to sort by Painter or not Painter. Oracle 10g Example Data:

  • 0

I just want to sort by Painter or not Painter.

Oracle 10g

Example Data:

job_type

  • cook
  • painter
  • programmer
  • mailman
  • receptionist
  • homemaker
  • father
  • mother
  • etc

A person can have one line for each job type but they can have several jobs.

SELECT   ...(LIST OF FIELDS)...,
         WM_CONCAT(job_type) AS myJob_Type
FROM     (MYTABLE)
GROUP BY ...(LIST OF FIELDS)...

This gives me all of the job_type’s in myJob_Type in a comma delimited list.
This works.

Now I want a way that I can sort by myJob_Type when the job has ‘Painter’ in it. I don’t care about any other job type. So my thought was to make a case where if Painter is in the myJob_Type but when I do get it to work I get muiltple lines again.

SELECT ...(LIST OF FIELDS)...,
WM_CONCAT(job_type) AS myJob_Type,
CASE WHEN(job_ype like '%Painter%') THEN '1'
ELSE '0'
END

FROM     (MYTABLE)
GROUP BY ...(LIST OF FIELDS)...,
         job_ype

Another option tried.

SELECT ...(LIST OF FIELDS)...,
WM_CONCAT(job_type) AS myJob_Type,

CASE WHEN(myJobType like '%Painter%') THEN '1'
ELSE '0'
END

FROM      (MYTABLE)
GROUP BY  ...(LIST OF FIELDS)...,
          myJobType 

Any suggestions.

  • 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-06-07T14:22:20+00:00Added an answer on June 7, 2026 at 2:22 pm

    You could try:

    select   ...
             wm_concat(job_type) as myJob_Type,
             sum(decode(job_type,'Painter',1,0))
    from     ...
    group by ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just want to use Collections.sort or Arrays.sort to sort a list of points
I just want to sort by first_name this list in python list = [
I'm not knowledgeable in the whole server-side idea. Right now, I just want to
I just want to sort this based on Month and year combination (that is,
Just want to ensure you that it is not a homework question. I am
I just want to know the difference between: sort < output and sort output
I am not looking for an algorithm to the above question. I just want
Just want to ask if i can use Custom Validator in client side without
Just want to make sure one thing. In a windows machine (either a desktop
Just want to know if publishing an application on Google play is allowed using

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.