Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

oracle query

Posted on 2013-07-01
4
Medium Priority
?
280 Views
Last Modified: 2013-07-01
CREATE TABLE TAB1
(
  DAY_SUNDAY     NUMBER(4),
  DAY_MONDAY     NUMBER(4),
  DAY_TUESDAY    NUMBER(4),
  DAY_WEDNESDAY  NUMBER(4),
  DAY_THURSDAY   NUMBER(4),
  DAY_FRIDAY     NUMBER(4),
  DAY_SATURDAY   NUMBER(4),
  BLOOD_TYPE     NUMBER
)



Insert into TAB1
   (DAY_SUNDAY, DAY_MONDAY, DAY_TUESDAY, DAY_WEDNESDAY, DAY_THURSDAY,
    DAY_FRIDAY, DAY_SATURDAY, BLOOD_TYPE)
 Values
   (10, 11, 12, 13, 14,
    15, 16, 84);
Insert into TAB1
   (DAY_SUNDAY, DAY_MONDAY, DAY_TUESDAY, DAY_WEDNESDAY, DAY_THURSDAY,
    DAY_FRIDAY, DAY_SATURDAY, BLOOD_TYPE)
 Values
   (20, 21, 22, 23, 24,
    25, 26, 28);
Insert into TAB1
   (DAY_SUNDAY, DAY_MONDAY, DAY_TUESDAY, DAY_WEDNESDAY, DAY_THURSDAY,
    DAY_FRIDAY, DAY_SATURDAY, BLOOD_TYPE)
 Values
   (30, 31, 32, 33, 34,
    35, 36, 62);
Insert into TAB1
   (DAY_SUNDAY, DAY_MONDAY, DAY_TUESDAY, DAY_WEDNESDAY, DAY_THURSDAY,
    DAY_FRIDAY, DAY_SATURDAY, BLOOD_TYPE)
 Values
   (40, 41, 42, 43, 44,
    45, 46, 6);
Insert into TAB1
   (DAY_SUNDAY, DAY_MONDAY, DAY_TUESDAY, DAY_WEDNESDAY, DAY_THURSDAY,
    DAY_FRIDAY, DAY_SATURDAY, BLOOD_TYPE)
 Values
   (50, 51, 52, 53, 54,
    55, 56, 73);
Insert into TAB1
   (DAY_SUNDAY, DAY_MONDAY, DAY_TUESDAY, DAY_WEDNESDAY, DAY_THURSDAY,
    DAY_FRIDAY, DAY_SATURDAY, BLOOD_TYPE)
 Values
   (70, 71, 72, 73, 74,
    75, 76, 51);
Insert into TAB1
   (DAY_SUNDAY, DAY_MONDAY, DAY_TUESDAY, DAY_WEDNESDAY, DAY_THURSDAY,
    DAY_FRIDAY, DAY_SATURDAY, BLOOD_TYPE)
 Values
   (60, 61, 62, 63, 64,
    65, 66, 95);
COMMIT;

---------------------------------------

Required data is

I want the data to be displayed they way I have attached the screen print.

Daya as columns and blood type as rows.
screen-print.JPG
0
Comment
Question by:anumoses
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39291280
I'm not seeing anything 'special' about your expected output aside from the day data missing.

Can you explain a little more about what you are wanting.
0
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 1000 total points
ID: 39291292
It looks like a straight select?

select BLOOD_TYPE, DAY_SUNDAY, DAY_MONDAY, DAY_TUESDAY, DAY_WEDNESDAY, DAY_THURSDAY, DAY_FRIDAY, DAY_SATURDAY
from tab1
order by blood_type;
0
 
LVL 6

Author Comment

by:anumoses
ID: 39291302
I did the same and just wanted to confirm. Thanks,
0
 
LVL 6

Author Closing Comment

by:anumoses
ID: 39291305
thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question