473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Decode question

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
2 5977

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

--
Posted via http://dbforums.com
Jul 19 '05 #2
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Pavils Jurjans | last post by:
Hallo, I am working on multilingual web-application, and I have to be very sure about how the international characters are encoded and decoded in the client-server form requests. There's a...
0
by: richasaraf | last post by:
Hello everyone, Please HELP !!!!! I'm facing problem in converting CASE statements into DECODE. As i have PL/SQL 8i, so it does not handle CASE statements. Please send me the solutions . Then...
2
by: cortukmehmet | last post by:
Hi everybody 1)how can i get the encoding type a dat file? 2)how can i decode it?
1
by: MP | last post by:
I have the following command. SELECT A.STORE_NAME, A.STORE_NUM, A.ZIP_CODE, B.EMPLOYEE_ID, B.GENDER, B.EMP_LEVEL, C.ITEM_CODE, DECODE(B.ITEM_CODE,1, 'CHICK_BURGERS') ITEM_DESCR,...
2
by: rsd | last post by:
Hi, I'm trying get Samsung YH-920 mp3 player to work with Debian GNU/Linux. To do that I need to run http://www.paul.sladen.org/toys/samsung-yh-925/yh-925-db-0.1.py script, the idea behind the...
1
by: dande | last post by:
my problem is I have used invoice table, patient table.In Invoice table date,cash,credit, cheque,advance,total is coming.but in patient table having registration type code having gen registraion...
0
by: james.duckworthy | last post by:
Python programmers may find the application to decoding an encrypted map image format known as Memory Map to produce a standard PNG image file interesting. Someone obviously very well versed in...
15
by: glacier | last post by:
I use chinese charactors as an example here. "'\\xc4\\xe3\\xba\\xc3\\xc2\\xf0'" My first question is : what strategy does 'decode' use to tell the way to seperate the words. I mean since s1 is...
1
by: anonymous | last post by:
1 Objective to write little programs to help me learn German. See code after numbered comments. //Thanks in advance for any direction or suggestions. tk 2 Want keyboard answer input, for...
2
by: John Savage | last post by:
I save posts from a midi music newsgroup, some are encoded with yenc encoding. This gave me an opportunity to try out the decoders in Python. The UU decoder works okay, but my YENC effort gives...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.