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

Поиск
Список
Период
Сортировка
От Tena Sakai
Тема Re: it's not NULL, then what is it?
Дата
Msg-id FE44E0D7EAD2ED4BB2165071DB8E328C04E84C07@egcrc-ex01.egcrc.org
обсуждение исходный текст
Ответ на it's not NULL, then what is it?  ("Tena Sakai" <tsakai@gallo.ucsf.edu>)
Ответы Re: it's not NULL, then what is it?  (Rob Sargent <robjsargent@gmail.com>)
Список pgsql-sql
<p><font size="2">Hi Osvaldo,<br /><br /> > Try:<br /> > SELECT count(*) FROM gallo.sds_seq_reg_shw;<br /> >
SELECTcount(*) FROM gallo.sds_seq_reg_shw WHERE maf IS NULL;<br /> > SELECT count(*) FROM gallo.sds_seq_reg_shw
WHEREmaf IS NOT NULL;<br /><br /> > Don't use count(maf), use count(*).<br /><br /> Indeed!<br /><br />   canon=#
SELECTcount(*) FROM gallo.sds_seq_reg_shw;<br />     count <br />   ---------<br />    4645647<br />   (1 row)<br /><br
/>  canon=# SELECT count(*) FROM gallo.sds_seq_reg_shw WHERE maf IS NULL;<br />     count <br />   ---------<br />   
4578363<br/>   (1 row)<br /><br />   canon=# SELECT count(*) FROM gallo.sds_seq_reg_shw WHERE maf IS NOT NULL;<br />   
count<br/>   -------<br />    67284<br />   (1 row)<br /><br /> $ dc<br /> 4578363 67284 + p q<br /> 4645647<br /> $<br
/><br/> Many thanks, Osvald.<br /><br /> Regards,<br /><br /> Tena Sakai<br /> tsakai@gallo.ucsf.edu<br /><br /><br
/><br/><br /> -----Original Message-----<br /> From: Osvaldo Kussama [<a
href="mailto:osvaldo.kussama@gmail.com">mailto:osvaldo.kussama@gmail.com</a>]<br/> Sent: Tue 6/30/2009 6:49 PM<br />
To:Tena Sakai<br /> Subject: Re: [SQL] it's not NULL, then what is it?<br /><br /> 2009/6/30 Tena Sakai
<tsakai@gallo.ucsf.edu>:<br/> > Hi Everybody,<br /> ><br /> > I have a table called
gallo.sds_seq_reg_shw,<br/> > which is like:<br /> ><br /> >   canon=# \d gallo.sds_seq_reg_shw<br /> >
      Table "gallo.sds_seq_reg_shw"<br /> >         Column      |  Type   | Modifiers<br /> >  
------------------+---------+-----------<br/> >    name             | text    |<br /> >    response         |
text   |<br /> >    n                | integer |<br /> >    source           | text    |<br /> >   
test            | text    |<br /> >    ref              | text    |<br /> >    value            | real    |<br />
>   pvalue.term      | real    |<br /> >    stars.term       | text    |<br /> >    gtclass.test     | text   
|<br/> >    fclass.test      | text    |<br /> >    gtclass.ref      | text    |<br /> >    fclass.ref       |
text   |<br /> >    markerid         | integer |<br /> >    maf              | real    |<br /> >   
chromosome      | text    |<br /> >    physicalposition | integer |<br /> >    id               | text    |<br />
>   ctrast           | text    |<br /> ><br /> > I am intereseted in the column maf (which is real):<br />
><br/> >   canon=# select maf from gallo.sds_seq_reg_shw<br /> >   canon-#  order by maf asc;<br /> >
      maf<br /> >   -------------<br /> >    0.000659631<br /> >    0.000659631<br /> >    0.000659631<br
/>>    0.000659631<br /> >         .<br /> >   (trunacated for the interest of breivity)<br /> >        
.<br/> ><br /> > Another way to look at this column is:<br /> ><br /> >   canon=# select maf from
gallo.sds_seq_reg_shw<br/> >   canon-#  order by maf desc;<br /> >        maf<br /> >   -------------<br />
><br/> ><br /> ><br /> >         .<br /> >   (trunacated for the interest of breivity)<br /> >
       .<br /> ><br /> > These rows shown are blanks, as far as I can tell.<br /> > But...<br /> ><br />
>  canon=# select count(maf) from gallo.sds_seq_reg_shw;<br /> >    count<br /> >   -------<br /> >   
67284<br/> >   (1 row)<br /> ><br /> >   canon=# select count(maf) from gallo.sds_seq_reg_shw<br /> >  
canon-# where maf ISNULL;<br /> >    count<br /> >   -------<br /> >        0<br /> >   (1 row)<br />
><br/> >   canon=#<br /> >   canon=# select count(maf) from gallo.sds_seq_reg_shw<br /> >   canon-#  where
mafNOTNULL;<br /> >    count<br /> >   -------<br /> >    67284<br /> >   (1 row)<br /> ><br /> > My
confusionis that if they are real and not null,<br /> > what are they?  How would I construct a query to do<br />
>something like:<br /> ><br /> >  select count(maf)<br /> >    from gallo.sds_seq_reg_shw<br /> >  
wheremaf ISBLANK;<br /> ><br /><br /><br /> Try:<br /> SELECT count(*) FROM gallo.sds_seq_reg_shw;<br /> SELECT
count(*)FROM gallo.sds_seq_reg_shw WHERE maf IS NULL;<br /> SELECT count(*) FROM gallo.sds_seq_reg_shw WHERE maf IS NOT
NULL;<br/><br /> Don't use count(maf), use count(*).<br /><br /> Osvaldo<br /><br /></font> 

В списке pgsql-sql по дате отправления:

Предыдущее
От: "Tena Sakai"
Дата:
Сообщение: Re: it's not NULL, then what is it?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: it's not NULL, then what is it?