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
while creating requisitions i am unable to see the list of organisation can anyone help me out ?
Explain how to close periods in ar. : oracle accounts receivable
What is autocashrule set? : oracle accounts receivable
HOW TO SPOT AHIERARCHY?
what ASIS BUSINESS PROCESS IN ORACLE FINANCE
Which is the best institute in Hyderabad to learn OBIEE and DataStage?Please tell me faculty name also
What is chargeback invoice? How do we create it? : oracle accounts receivable
What is the use of lockboxes? Steps for lock box : oracle accounts receivable
we have 10 concurrent programs under one request group out of 10 ccps all users submitting only 9 programs from srs window remaining one ccp for specific user how can it possible send me answer asap.
Could you please let me know the interfaces in OM / FA??
What is the difference between oracle media recovery and crash recovery?
What are the advantages of operating a database in ARCHIVELOG mode over operating it in NO ARCHIVELOG mode in Oracle?
what is difference between inner join & nested query or subqueries
What is supporting issues GL AP and AR?
What is the disk migration? what is the steps involved in oracle disk migration?