Search Postgresql Archives

Re: SELECT question (splitting a field)

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

 



On 9/4/07, Madison Kelly <linux@xxxxxxxxxxx> wrote:
> Hi all,
>
>    Hopefully a quick question...
>
>    Why does:
>
> nmc=> SELECT 'Y' AS local FROM domains WHERE dom_name='test.com';
>   local
> -------
>   Y
> (1 row)
>
>    Work but:
>
> nmc=> SELECT 'Y' AS local FROM domains WHERE '@'||dom_name IN
> ('mkelly@xxxxxxxx');
>   local
> -------
> (0 rows)
>
>    Not work?

because @dom_name isn't IN mkelly@xxxxxxxx?

I think you're looking for pattern matching.

select 'Y' as local from domains where dom_name ilike '%test.com%'

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org/

[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