rakesh


{ City } delhi
< Country > india
* Profession * software developer
User No # 48456
Total Questions Posted # 0
Total Answers Posted # 2

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 2
Users Marked my Answers as Wrong # 0
Questions / { rakesh }
Questions Answers Category Views Company eMail




Answers / { rakesh }

Question { Lucent, 28221 }

100 glasses are there. A servant has to supply glasses to a
person If he supplies the glasses without any damage he
will get 3 paise otherwise he will loose 3 paise. At the
end of supplying 100 glasses if he gets 270 paise, how many
glasses were supplied safely.


Answer

lets total sefty glass are x;
then dameg glass are 100-x;
so equation is

3*x - 3*(100-x) = 270
x-100+x = 90;
2x = 190;
x = 190/2
x=95

so ans will be 95

Is This Answer Correct ?    1 Yes 0 No

Question { 12449 }


Table name: T1, it has only one column.

col1
------
c
b
a
b
b
b
b
d
s
a
a
t
s


Requirement:

I need the following output from the above base table by
using SQL query.


col1 Cnt
----- -------
a 3
b 5
Others 5


Please help.

Thanks
Guru
v.gurus@in.com









Answer

select name ,count(name)as cnt from (
select case when ((name ='a') or (name = 'b') )then name
else
'others' end as 'name' from tbl_count ) as temp group by
name

Is This Answer Correct ?    1 Yes 0 No