Re: query help

Поиск
Список
Период
Сортировка
От Steve Crawford
Тема Re: query help
Дата
Msg-id 46E95AE2.6020304@pinpointresearch.com
обсуждение исходный текст
Ответ на Re: query help  (volunteer@spatiallink.org)
Список pgsql-general
volunteer@spatiallink.org wrote:
> hello
> i add more column not row for new user. i want all "last like 'J%'".
> http://www.nabble.com/an-other-provokative-question---tf4394285.html
> sincerely
> siva

You add a new _column_ for each user?!? That is hideously broken in so
many ways. It makes the trivially easy query you are trying to write
rather complicated, prevents you from being able to use indexes for
either constraints or performance and requires you to change your table
definition anytime you add data. And that's just for starters.

Fix your table so it has three columns (id, first, last). Then your
query is as easy as:
select id,first,last from foo where last like 'J%';

Cheers,
Steve


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

Предыдущее
От: "Alexander Staubo"
Дата:
Сообщение: Re: query help
Следующее
От: volunteer@spatiallink.org
Дата:
Сообщение: Re: query help