Re: convert query from mysql

Поиск
Список
Период
Сортировка
От Jaime Casanova
Тема Re: convert query from mysql
Дата
Msg-id CAJKUy5jyhHcp-MAt4MGZSp0iDTa7C-uafc=1-hZvdxR4qmBQTA@mail.gmail.com
обсуждение исходный текст
Ответ на convert query from mysql  ("Mike Andrewjeski" <Mike.Andrewjeski@businesswire.com>)
Ответы Re: convert query from mysql  (Sameer Kumar <sameer.kumar@ashnik.com>)
Список pgsql-novice
On Tue, Dec 17, 2013 at 3:44 PM, Mike Andrewjeski
<Mike.Andrewjeski@businesswire.com> wrote:
>
> Hi all,
>
> psql newbie here. I'm working to convert a mysql query written in ruby to
> using postgres as our database is now postgres 9.2
>
> Here's the mysql query:
>
> select nodes.name, GROUP_CONCAT(node_groups.name) from node_groups,
> node_group_memberships, nodes where nodes.id =
> node_group_memberships.node_id and node_groups.id =
> node_group_memberships.node_group_id and nodes.name IN (SELECT name
> from nodes) group by nodes.name order by nodes.name")
> What I'm having an issue with is the IN Clause.  Not sure how to do that in
> psql.
>

Hi,

I was looking at this and i admit i don't understand how that IN could
ever be false (which could be caused by the beer i just drank).
The reason i don't understand it is that you are checking if the names
in table nodes exists in the table nodes :S


--
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitación
Phone: +593 4 5107566         Cell: +593 987171157


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

Предыдущее
От: Michael Swierczek
Дата:
Сообщение: Re: How to connect to a database psql doesn't see
Следующее
От: Sameer Kumar
Дата:
Сообщение: Re: convert query from mysql