Re: it's not NULL, then what is it?

From: "Tena Sakai" <tsakai(at)gallo(dot)ucsf(dot)edu>
To: "Rob Sargent" <robjsargent(at)gmail(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: it's not NULL, then what is it?
Date: 2009-07-01 00:55:41
Message-ID: FE44E0D7EAD2ED4BB2165071DB8E328C04E84C02@egcrc-ex01.egcrc.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi Rob,

> Maybe something like

> select ']' || maf::text || '[' -- just to see where the value
> start/stops

It prints many (1,132,691 to be exact) lines consisting of 7 space
characters followed by many lines like:
]0.0106383[
]0.0106383[
]0.0106383[

> or

> select length(maf::text)

This results in many lines of 7 space characters, followed by a
bunch of 9's, 10's, 8's...

> but I suspect you're getting NAN or something unprintable in your
> environment?

Yes, me too. But,

canon=# select maf
canon-# from gallo.sds_seq_reg_shw
canon-# where maf = NAN;
ERROR: column "nan" does not exist
LINE 3: where maf = NAN;
^

What can I put to the right of equal sign to make the query work?

Regards,

Tena Sakai
tsakai(at)gallo(dot)ucsf(dot)edu

-----Original Message-----
From: Rob Sargent [mailto:robjsargent(at)gmail(dot)com]
Sent: Tue 6/30/2009 3:24 PM
To: Tena Sakai
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] it's not NULL, then what is it?

Tena Sakai wrote:
>
> Hi Everybody,
>
> I have a table called gallo.sds_seq_reg_shw,
> which is like:
>
> canon=# \d gallo.sds_seq_reg_shw
> Table "gallo.sds_seq_reg_shw"
> Column | Type | Modifiers
> ------------------+---------+-----------
> name | text |
> response | text |
> n | integer |
> source | text |
> test | text |
> ref | text |
> value | real |
> pvalue.term | real |
> stars.term | text |
> gtclass.test | text |
> fclass.test | text |
> gtclass.ref | text |
> fclass.ref | text |
> markerid | integer |
> maf | real |
> chromosome | text |
> physicalposition | integer |
> id | text |
> ctrast | text |
>
> I am intereseted in the column maf (which is real):
>
> canon=# select maf from gallo.sds_seq_reg_shw
> canon-# order by maf asc;
> maf
> -------------
> 0.000659631
> 0.000659631
> 0.000659631
> 0.000659631
> .
> (trunacated for the interest of breivity)
> .
>
> Another way to look at this column is:
>
> canon=# select maf from gallo.sds_seq_reg_shw
> canon-# order by maf desc;
> maf
> -------------
>
>
>
> .
> (trunacated for the interest of breivity)
> .
>
> These rows shown are blanks, as far as I can tell.
> But...
>
> canon=# select count(maf) from gallo.sds_seq_reg_shw;
> count
> -------
> 67284
> (1 row)
>
> canon=# select count(maf) from gallo.sds_seq_reg_shw
> canon-# where maf ISNULL;
> count
> -------
> 0
> (1 row)
>
> canon=#
> canon=# select count(maf) from gallo.sds_seq_reg_shw
> canon-# where maf NOTNULL;
> count
> -------
> 67284
> (1 row)
>
> My confusion is that if they are real and not null,
> what are they? How would I construct a query to do
> something like:
>
> select count(maf)
> from gallo.sds_seq_reg_shw
> where maf ISBLANK;
>
> Thank you in advance.
>
> Regards,
>
> Tena Sakai
> tsakai(at)gallo(dot)ucsf(dot)edu
>
Maybe something like

select ']' || maf::text || '[' -- just to see where the value
start/stops

or

select length(maf::text)

but I suspect you're getting NAN or something unprintable in your
environment?

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tena Sakai 2009-07-01 00:56:36 Re: it's not NULL, then what is it?
Previous Message Thomas Kellerer 2009-06-30 22:41:35 Re: it's not NULL, then what is it?