473,327 Members | 2,074 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,327 software developers and data experts.

Compare Zero,NULL and one without if condition

Hi All,
I'm Abdelrazag,I have one column which have the following values (0,1,NULL) and I wrote procedure which work fine using if condition that if user send 0 as value I will get all row where value 0 exist and NULL also or else display where 1 exist in the data,but can any one help me to do it without if statment.


Best Regards
Dec 20 '06 #1
2 4934
willakawill
1,646 1GB
Hi All,
I'm Abdelrazag,I have one column which have the following values (0,1,NULL) and I wrote procedure which work fine using if condition that if user send 0 as value I will get all row where value 0 exist and NULL also or else display where 1 exist in the data,but can any one help me to do it without if statment.


Best Regards
Hi, please post your code.
Dec 20 '06 #2
iburyak
1,017 Expert 512MB
Try this

[PHP]isnull(column_name_here, 0) = value[/PHP]


Here if value = 0 or null it will pick both otherwise it will pick what ever value is.
Dec 20 '06 #3

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

Similar topics

1
by: GitarJake | last post by:
Hello all, I am new to sql and have some Access experience. In sql, how do I: compare 2 identical tables, (except for data); then update table 1 with new data from table 2 TIA Jake
6
by: Frank | last post by:
I spent over an hour on the Internet & MSDN looking for an answer that worked for this problem. Lots of answers, none work. It's time to post a question. Using: VB6, ADO, MS Jet 4.0 How do...
53
by: Zhiqiang Ye | last post by:
Hi, All I am reading FAQ of this group. I have a question about this: http://www.eskimo.com/~scs/C-faq/q7.31.html It says: " p = malloc(m * n); memset(p, 0, m * n); The zero fill is...
122
by: Einar | last post by:
Hi, I wonder if there is a nice bit twiddling hack to compare a large number of variables? If you first store them in an array, you can do: for (i = 0; i < n; i++) { if (array != value) {...
17
by: bengamin | last post by:
Hi, I have a C# class and two instance of the class; the class have some property. I want to compare the property value of the two instance How should i do? override == ? use delegate ?
10
by: Sek | last post by:
I have a property that returns a ArrayList object. On failure condition, is it right to return null or return an ArrayList object with zero elements?
17
by: Mark A | last post by:
DB2 8.2 for Linux, FP 10 (also performs the same on DB2 8.2 for Windoes, FP 11). Using the SAMPLE database, tables EMP and EMLOYEE. In the followng stored procedure, 2 NULL columns (COMM) are...
10
by: lovecreatesbea... | last post by:
Is it correct and safe to compare a string object with "", a pair of quotation marks quoted empty string?If the string object: s = ""; does s contain a single '\'? Is it better to use...
11
by: MC | last post by:
I have a couple of customers who are using a program that deserializes an XML file, and on some files, the program fails to see the content of the file -- treats it as zero length and reports "root...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.