Unix Technical Forum

matching empty column

This is a discussion on matching empty column within the pgsql Novice forums, part of the PostgreSQL category; --> hello group: I have a table that has 500,000 rows. tar_id | mid | seq_id | lscore --------+-------+--------+-------- 32014 ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 10:08 PM
Srinivas Iyyer
 
Posts: n/a
Default matching empty column

hello group:

I have a table that has 500,000 rows.

tar_id | mid | seq_id | lscore
--------+-------+--------+--------
32014 | | 50473 | 814
32015 | 67 | 50473 | 814
32016 | 461 | 50473 | 814
32017 | | 52964 | 857
32018 | 428 | 52964 | 822
32019 | 98 | 51208 | 737
32020 | 435 | 51208 | 737
32021 | | 51208 | 764
32022 | 98 | 41066 | 759
32023 | 431 | 41066 | 593
32024 | 250 | 41066 | 659

The mid column is empty in certain places. how can I
search if there are empty spaces in mid.

Thanks.


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 10:08 PM
Srinivas Iyyer
 
Posts: n/a
Default Re: matching empty column

oops ! sorry. I should not have written before
thinking and referring to documentation.

select * from TABLE where mid is NULL;



--- Srinivas Iyyer <srini_iyyer_bioop@yahoo.com>
wrote:

> hello group:
>
> I have a table that has 500,000 rows.
>
> tar_id | mid | seq_id | lscore
> --------+-------+--------+--------
> 32014 | | 50473 | 814
> 32015 | 67 | 50473 | 814
> 32016 | 461 | 50473 | 814
> 32017 | | 52964 | 857
> 32018 | 428 | 52964 | 822
> 32019 | 98 | 51208 | 737
> 32020 | 435 | 51208 | 737
> 32021 | | 51208 | 764
> 32022 | 98 | 41066 | 759
> 32023 | 431 | 41066 | 593
> 32024 | 250 | 41066 | 659
>
> The mid column is empty in certain places. how can I
> search if there are empty spaces in mid.
>
> Thanks.
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: don't forget to increase your free space map
> settings
>



__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 10:08 PM
Alan Hodgson
 
Posts: n/a
Default Re: matching empty column

On Thursday 24 August 2006 10:27, Srinivas Iyyer <srini_iyyer_bio@yahoo.com>
wrote:
> tar_id | mid | seq_id | lscore
> --------+-------+--------+--------
> 32014 | | 50473 | 814
> 32015 | 67 | 50473 | 814
> The mid column is empty in certain places. how can I
> search if there are empty spaces in mid.
>


select tar_id from table where mid is null;

(assuming it's a numeric and not a text field set to '')

--
Alan

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-17-2008, 10:08 PM
Bruno Wolff III
 
Posts: n/a
Default Re: matching empty column

On Thu, Aug 24, 2006 at 10:27:16 -0700,
Srinivas Iyyer <srini_iyyer_bio@yahoo.com> wrote:
>
> The mid column is empty in certain places. how can I
> search if there are empty spaces in mid.


'empty' is not a good word to use when referring to null values. An empty
string is not the same as a null (despite what Oracle thinks).

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:59 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com