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

How can you fetch first 5 characters of the string?

0 Answers  


Lookups are a key component in sql server integration services (ssis). Explain its purpose?

0 Answers  


How do I save a sql query?

0 Answers  


how to create table with in the procedure or function?

2 Answers   Genpact, HCL,


The in operator may be used if you know the exact value you want to return for at least one of the columns.

0 Answers  


Define tables and fields in a database

0 Answers  


What is sql rowcount?

0 Answers  


Enlist the characteristics of pl/sql?

0 Answers  


What is aggregate function in sql?

0 Answers  


What is group function in sql?

0 Answers  


What is substitution variable in pl sql?

0 Answers  


What is number function in sql?

0 Answers  


Categories