Search Postgresql Archives

Re: Need efficient way to do comparison with NULL as an option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



D. Dante Lorenso wrote:
But if I want to find all the items which are not in any folder, I want:

  SELECT *
  FROM mytable
  WHERE folder_id IS NULL;

I don't have any folder_id 0, so on a URL I might do this:

  http://xyz/page.php?fid=123
  http://xyz/page.php?fid=0

SELECT * FROM mytable WHERE COALESCE( folder_id, 0 ) = 0;

--
Lew

---------------------------(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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux