Re: Query will execute when inner query have issue

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Query will execute when inner query have issue
Дата
Msg-id CAKFQuwZx=0T+P_kGJ38mCFHUwmkO8Mi4ow6ADZ5hMnsOkAFQaw@mail.gmail.com
обсуждение исходный текст
Ответ на RE: Query will execute when inner query have issue  (selva kumar <selva.logic@hotmail.com>)
Список pgsql-bugs
On Thu, Jan 23, 2020 at 9:19 AM selva kumar <selva.logic@hotmail.com> wrote:

But the following query will executed

select * from product where productid in (select productid from sales where salesdate='2020-01-22')



Which isn't the same as what you first posted because of the absence of table qualifications.  That single difference, explained by Tom, completely explains why the original post did in fact provoke and error and this query does not.

The take-away is make sure to test your queries; and when dealing with sub-queries its usually a good idea of add a table qualification to your fields.

David J.

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

Предыдущее
От: selva kumar
Дата:
Сообщение: RE: Query will execute when inner query have issue
Следующее
От: Andrew Roffey
Дата:
Сообщение: Re: BUG #16225: EL8 - PGDG postgresql* packages conflict withappstream postgresql packages