Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

oracle query

Posted on 2013-07-01
4
Medium Priority
?
281 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
  • 2
  • 2
4 Comments
 
LVL 78

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 78

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
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.
Suggested Courses

824 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