Re: query help

Поиск
Список
Период
Сортировка
От brian
Тема Re: query help
Дата
Msg-id 46E95C3C.9060307@zijn-digital.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%'".

I get the feeling that the result as you've laid it out is not what we
all think it is. For example:

 >>table is
 >>+-------+-------+------+-------+
 >>| id | one | two | three |
 >>+-------+-------+------+-------+
 >>| first | Jack | Jill | Mary |
 >>| last | Ja | Ji | Ma |
 >>+-------+-------+------+-------+

I took that to meant that you have columns 'id', 'one', two', three',
and that 'first' & 'last' are field values. However, it now seems that
'first' & 'last' are column names. If so, this makes no sense. I think
what you wanted to give us was:

+-------+-------+------+
|   id  | first | last |
+-------+-------+------+
|  one  |  Jack |  Ja  |
|  two  |  Jill |  Ji  |
| three |  Mary |  Ma  |

result:

+-------+-------+------+
|   id  | first | last |
+-------+-------+------+
|  one  |  Jack |  Ja  |
|  two  |  Jill |  Ji  |

So, the query you want is, in fact:

SELECT * FROM your_table WHERE last LIKE ('J%');

If that's not working for you, it's perhaps because you have rows for
columns and columns for rows.

> http://www.nabble.com/an-other-provokative-question---tf4394285.html
> sincerely
> siva
>

What the heck does this have to do with anything?

Please don't top-post.

brian

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

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