By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,323 Members | 1,216 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,323 IT Pros & Developers. It's quick & easy.

Decode question

P: n/a
does exist any chance to do in SQL , without using PL/SQL code like it:

select project_type,
decode (project_type,
1, select count(*) from t1,
2, select count(*) from t2,
3, select count(*) from t3,
0) count_prj
from projects

Thanks
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

Your question is not clear, you need to provide more
requiremets/specifications.

--
Posted via http://dbforums.com
Jul 19 '05 #2

P: n/a
"Julia Sats" <ju********@sympatico.ca> wrote in message news:<2F*******************@news20.bellglobal.com> ...
does exist any chance to do in SQL , without using PL/SQL code like it:

select project_type,
decode (project_type,
1, select count(*) from t1,
2, select count(*) from t2,
3, select count(*) from t3,
0) count_prj
from projects

Thanks


sure. you almost had it. you just need some parens --

select project_type,
decode (project_type,
1, (select count(*) from t1),
2, (select count(*) from t2),
3, (select count(*) from t3),
0) count_prj
from projects
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.