0

Below is my query

SELECT * FROM companystatus where company_name='Fifth Borrower' ;

I want the not null values in single row for one borrower.current output

Expected output

expected output

1 Answer 1

1

Aggregation usually helps in such requirements, e.g.

select 
  company_code,
  company_name,
  max(c2015),
  max(c2016),
  max(c2017)
from companystatus
where company_name = 'Fifth Borrower'
group by company_code,
         company_name
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, is there anyway to select my columns as column name present in the table are integer?
In Oracle, a column name can't begin with a digit unless you enclose its name into double quotes. In my opinion, that's a bad idea. That's why I presumed that real column names aren't 2015, 2016, etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.