Search Postgresql Archives

Re: query help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



volunteer@xxxxxxxxxxxxxxx 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


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux