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...

1.In a table Gender is a column in that male and female are
the two data.In a single statement i have to modify all male
to female and all female to male vice versa.
2.In a single query i need the count of male data,count of
female and total count

Answer Posted / anithaletchumi

1.In a table Gender is a column in that male and female are
the two data.In a single statement i have to modify all male
to female and all female to male vice versa.

ans->
update emp_table e set gender = (select case gender
when 'F' then 'M' else 'F' end from emp_table f where
e.empid = f.empid and e.gender=f.gender);
-- empid is the primary key.

2.In a single query i need the count of male data,count of
female and total count

ans 1->
select ( select count(empid) from emp_table where
gender='m' or gender='M') as count_male, ( select count
(empid) from emp11 where gender='f' or gender='F') AS
count_female,( select count(empid) from emp_table) as
tot_count from dual;

ans 2->
select sum(decode(gender,'F',1,'f',1)) as count_female,sum
(decode(gender,'M',1,'m',1)) as count_male,count(*) as
tot_count from emp_table;

Is This Answer Correct ?    9 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

while creating requisitions i am unable to see the list of organisation can anyone help me out ?

2114


Hey i want to join oracle apps so will you pls tell me that which institute is best in hyderabad.

2300


Hi, I want to know basic information about Oracle HRMS and the institutes in hyderabad or the best faculty as i want to make my career in it.And also want to know may a person from non technical background be able to do this course. Regards, Swetha

2491


WHAT ALL DIFFERENT OPTIONS PRESENT IN WEBI?

2911


What is db_recovery_file_dest in oracle? When do you need to set this value?

1098


How would you determine who has added a row to a table?

2279


Can we modify approve purchase order?if yes what is navigation?

1975


Are These Dff's Flexible?

1140


What is the mandatory setup in cyclecount ?

2723


Why more redos are generated when the oracle database is in begin backup mode?

1095


What are the advantages of operating a database in ARCHIVELOG mode over operating it in NO ARCHIVELOG mode in Oracle?

1099


What is Tax Categories?

2072


What is the use of lockboxes? : oracle accounts receivable

1178


how to replace not in with not exist?

3684


What is the Difference between the Person_Type_id column in the per_all_people_f and per_person_type_usages_f

4417