Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


table having two columns - entity,zone
enity zone
pen east
pen west
pen north
pen south
pen east
pencil east
pencil east
pencil west

I want the output as :
entity east west north south
pen 2 1 1 1
pencil 2 1 0 0

Answers were Sorted based on User's Feedback



table having two columns - entity,zone enity zone pen east pen west pen north pen ..

Answer / aswini mohanty

select entity,sum(decode(zone,'east',1,0)) east,
sum(decode(zone,'west',1,0)) west,
sum(decode(zone,'north',1,0))north,
sum(decode(zone,'south',1,0))south
from t group by entity;

Is This Answer Correct ?    6 Yes 0 No

table having two columns - entity,zone enity zone pen east pen west pen north pen ..

Answer / lizamishra15

pls answer me this qeustion

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More SQL PLSQL Interview Questions

What are Lexical Parameters.How They are used in Reports 6i

2 Answers   eicc,


I m giving Source, Destination and Age. Write a procedure or function, it will give to u this source to destination tickets are available or not, if available then check this person is senior citizen or not,if this person is senior citizen then give some discount. PLZ give this answer...... Thanks advance.....

3 Answers  


Define select, insert, create, delete, update, drop keywords

0 Answers  


How do you rank data in sql?

0 Answers  


What are the differences between Database Trigger and Integrity constraints ?

4 Answers  


What is the order of sql select?

0 Answers  


Write a pl/sql script to display the following series of numbers: 99,96,93……9,6,3?

1 Answers  


what is meant by forward declaration in functions?

4 Answers   TCS,


How to set up sql*plus output format in oracle?

0 Answers  


What is the purpose of design view?

0 Answers  


what is explain plan?, given an example...

3 Answers   Polaris,


Query for second maximum salary in each in each department

15 Answers   DST Global Solutions, TCS,


Categories