Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Query to get the rows with null value

4 posts in General Discussion Last posting was on 2009-10-07 21:32:23.0Z
AJ Posted on 2009-10-07 20:44:42.0Z
Sender: 527e.4accf9b8.1804289383@sybase.com
From: aj
Newsgroups: sybase.public.ase.general
Subject: Query to get the rows with null value
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4accfdba.530d.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 7 Oct 2009 13:44:42 -0700
X-Trace: forums-1-dub 1254948282 10.22.241.41 (7 Oct 2009 13:44:42 -0700)
X-Original-Trace: 7 Oct 2009 13:44:42 -0700, 10.22.241.41
Lines: 8
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28431
Article PK: 77674

Hi,
I am trying to get rows with null values from one of my
table in the db but its not returning any result set at all.
I can see the table has about 1300 rows with null value.
Query I am using - Select * from a where permit_no is null;

Tnx
aj


"Mark A. Parsons" <iron_horse Posted on 2009-10-07 21:05:06.0Z
From: "Mark A. Parsons" <iron_horse@no_spamola.compuserve.com>
User-Agent: Thunderbird 1.5.0.10 (Windows/20070221)
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: Query to get the rows with null value
References: <4accfdba.530d.1681692777@sybase.com>
In-Reply-To: <4accfdba.530d.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Antivirus: avast! (VPS 091004-0, 10/04/2009), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4acd0282$1@forums-1-dub>
Date: 7 Oct 2009 14:05:06 -0700
X-Trace: forums-1-dub 1254949506 10.22.241.152 (7 Oct 2009 14:05:06 -0700)
X-Original-Trace: 7 Oct 2009 14:05:06 -0700, vip152.sybase.com
Lines: 18
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28432
Article PK: 77675

If permit_no is defined with a character datatype, what do you get with:

select * from a where lower(permit_no) = 'null'

Alternatively, how do you know the 1300 records have a NULL value for the permit_no column? [Wondering if you could be
looking at a different database, different [owner.]table or different column?]

Could you also verify that you're running ASE? (select @@version)

aj wrote:
> Hi,
> I am trying to get rows with null values from one of my
> table in the db but its not returning any result set at all.
> I can see the table has about 1300 rows with null value.
> Query I am using - Select * from a where permit_no is null;
>
> Tnx
> aj


AJ Posted on 2009-10-07 21:17:58.0Z
Sender: 527e.4accf9b8.1804289383@sybase.com
From: aj
Newsgroups: sybase.public.ase.general
Subject: Re: Query to get the rows with null value
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4acd0586.5495.1681692777@sybase.com>
References: <4acd0282$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 7 Oct 2009 14:17:58 -0700
X-Trace: forums-1-dub 1254950278 10.22.241.41 (7 Oct 2009 14:17:58 -0700)
X-Original-Trace: 7 Oct 2009 14:17:58 -0700, 10.22.241.41
Lines: 23
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28433
Article PK: 77676

Thanks Mark, it is working now. BTW, I am using ASE15.0 .

> If permit_no is defined with a character datatype, what do
> you get with:
>
> select * from a where lower(permit_no) = 'null'
>
> Alternatively, how do you know the 1300 records have a
> NULL value for the permit_no column? [Wondering if you
> could be looking at a different database, different
> [owner.]table or different column?]
>
> Could you also verify that you're running ASE? (select
> @@version)
>
> aj wrote:
> > Hi,
> > I am trying to get rows with null values from one of my
> > table in the db but its not returning any result set at
> > all. I can see the table has about 1300 rows with null
> > value. Query I am using - Select * from a where
> > permit_no is null;
> > Tnx
> > aj


"Mark A. Parsons" <iron_horse Posted on 2009-10-07 21:32:23.0Z
From: "Mark A. Parsons" <iron_horse@no_spamola.compuserve.com>
User-Agent: Thunderbird 1.5.0.10 (Windows/20070221)
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: Query to get the rows with null value
References: <4acd0282$1@forums-1-dub> <4acd0586.5495.1681692777@sybase.com>
In-Reply-To: <4acd0586.5495.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Antivirus: avast! (VPS 091004-0, 10/04/2009), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4acd08e7@forums-1-dub>
Date: 7 Oct 2009 14:32:23 -0700
X-Trace: forums-1-dub 1254951143 10.22.241.152 (7 Oct 2009 14:32:23 -0700)
X-Original-Trace: 7 Oct 2009 14:32:23 -0700, vip152.sybase.com
Lines: 26
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28434
Article PK: 77677

And the resolution?

aj wrote:
> Thanks Mark, it is working now. BTW, I am using ASE15.0 .
>> If permit_no is defined with a character datatype, what do
>> you get with:
>>
>> select * from a where lower(permit_no) = 'null'
>>
>> Alternatively, how do you know the 1300 records have a
>> NULL value for the permit_no column? [Wondering if you
>> could be looking at a different database, different
>> [owner.]table or different column?]
>>
>> Could you also verify that you're running ASE? (select
>> @@version)
>>
>> aj wrote:
>>> Hi,
>>> I am trying to get rows with null values from one of my
>>> table in the db but its not returning any result set at
>>> all. I can see the table has about 1300 rows with null
>>> value. Query I am using - Select * from a where
>>> permit_no is null;
>>> Tnx
>>> aj