473,513 Members | 2,291 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CASE stmt with isnull()

42 New Member
select country,
IsNull(A,0) as A,
IsNull(B,0) as B,
---- Here I need to add case stmt. I have data B in Db if it is B then I have to show C else I have to C

from <Table-name>

Please help me how to do this? It is very urgent

Thanks
Apr 23 '08 #1
2 1227
ck9663
2,878 Recognized Expert Specialist
select country,
IsNull(A,0) as A,
IsNull(B,0) as B,
---- Here I need to add case stmt. I have data B in Db if it is B then I have to show C else I have to C

from <Table-name>

Please help me how to do this? It is very urgent

Thanks

Use CASSE

-- CK
Apr 23 '08 #2
ganeshkumar08
31 New Member
Hello

Try this..

select country,
IsNull(A,0) as A,
IsNull(B,0) as B,
-- My code
case when isnull(B,0) < = 0 then C else C End as 'C'
from <Table-name>

If this is not ok, please explain me clearly i write and give u...

Ganesh
Apr 23 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
5627
by: Hareesh | last post by:
Hi, -- SQL Stmt 1 SELECT * FROM Table1 WHERE Field1 = 123 AND Field2 = 234 AND Field3 = 345 AND Field4 = 456 AND Field5 = 567 AND Field6 = 678
2
3838
by: claus.hirth | last post by:
I wrote a stored procedure that uses a prepared INSERT INTO statement in order to play with the PREPARE and EXECUTE keywords. In transcript 1 below the call to that stored procedure does not...
5
5624
by: Dave Brydon | last post by:
I'm checking for required fields, and using the code below, which I normally have no difficulties with; however, as a twist I decided to return the focus back to the specific field(s) in question...
1
2998
by: Uzytkownik | last post by:
I've some function: function show($id) { $title = $text = $date = $nick = NULL; $stmt = $this->base->stmt_init(); $stmt->prepare("SELECT title,text,datetime,nick FROM posts LEFT JOIN authors ON...
0
1329
by: subin78 | last post by:
Hi All, Im new to DB2. I need to to write a query using CASE stmt the Scenario is like this when DAYNAME = 'sunday' select * from table where LASTUPDATE = current date-1 else select...
6
2496
by: ccsoupy22 | last post by:
For simplicity sake, here are the basics of the query I am stumped on... Type: Select query Name: ColorCells Below is a partial list of the "Cases" for the code (I did not think there was...
4
2653
by: Patrick A | last post by:
All, I rely on nested IF statements with multiple conditions heavily, and someone suggested recently writing the statements (and especially reading them months later) would be much easier if I...
56
6664
by: Adem | last post by:
C/C++ language proposal: Change the 'case expression' from "integral constant-expression" to "integral expression" The C++ Standard (ISO/IEC 14882, Second edition, 2003-10-15) says under...
0
1901
by: pankaj17 | last post by:
hello everyone, MYSQL query ............ how to set prepare stmt result in variable i have written prepare stmt in store procedure and i want to set result of prepare stmt in variable ...
0
7269
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7177
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7394
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7559
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7123
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
3248
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3237
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.