How to select text field as interger

Поиск
Список
Период
Сортировка
От Jerrel Kemper
Тема How to select text field as interger
Дата
Msg-id 4C2A5CB4.3000601@s-wise.nl
обсуждение исходный текст
Список pgsql-sql
Dear members,


My table consist off the following fields


CREATE TABLE test
(  id bigserial NOT NULL,  name character varying(100),   CONSTRAINT logs_pkey PRIMARY KEY (log_id)
)


with value :

ID    Name
1      001
2        01
3          1
4        11

Select name from test where name = '1' ;

results in :

Name  1


If the 'Name' field was define as a serial the result set ought to be

Name  001    01      1


Question?

How can I have the same result set as above

Name  001    01      1


with the name field defined as character varying.



Thanks


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

Предыдущее
От: ced
Дата:
Сообщение: Re: Outer join construction step :strange results
Следующее
От: Tim Landscheidt
Дата:
Сообщение: Re: How to select text field as interger