Обсуждение: understanding a nested query

Поиск
Список
Период
Сортировка

understanding a nested query

От
Rowan
Дата:

I would like to create a nested statement but am unsure of the correct
syntax. My statement shoudl read someting like

SELECT field1, field2 FROM table WHERE name ILIKE xxx AND ( street
ILIKE xxxx or street2 ILIKE xxxx)

so basically it needs to match name and either street or street 2..

any help woudl be greatly appreciated.

Re: understanding a nested query

От
Ben
Дата:
On Thu, 12 Jun 2008, Rowan wrote:

> I would like to create a nested statement but am unsure of the correct
> syntax. My statement shoudl read someting like
>
> SELECT field1, field2 FROM table WHERE name ILIKE xxx AND ( street
> ILIKE xxxx or street2 ILIKE xxxx)
>
> so basically it needs to match name and either street or street 2..

That's not a subquery, it's just grouping clauses. Your SQL matches your
description of what you want. Maybe you want something else?