Re: SELECT...FOR UPDATE

Поиск
Список
Период
Сортировка
От Andreas Plesner Jacobsen
Тема Re: SELECT...FOR UPDATE
Дата
Msg-id 20020711202757.GL22168@nerd.dk
обсуждение исходный текст
Ответ на Re: SELECT...FOR UPDATE  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Ответы Re: SELECT...FOR UPDATE  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-general
On Thu, Jul 11, 2002 at 01:16:53PM -0700, Stephan Szabo wrote:
> >
> > SELECT table1.Id, table1.User, table1.Data1, table2.data1
> > FROM   table1, table2
> > FOR UPDATE OF table1
> > LIMIT  1000
>
> I don't think I understand the specification here.  It sounds to me
> you want to get the rows where User is null, but the above query
> doesn't reflect that, so I must be misunderstanding.

You're quite right, I missed the where clause there:

WHERE table1.user is null and table1.fk_table2=table2.id

> I'd suggest running with query printing turned on to see in more
> detail what's going on.

I know the exact query, so I don't see, where that would help?

--
Andreas Plesner Jacobsen | He who laughs has not yet heard the bad news.
                         |             -- Bertolt Brecht

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: SELECT...FOR UPDATE
Следующее
От: Laurette Cisneros
Дата:
Сообщение: collating advice