Re: [SQL] How to select text field as interger

2010-06-30 Thread silly sad
| SELECT Name FROM Test WHERE Name::INT = 1; But note that this is going to throw an error if there are any table rows where the name field *doesn't* contain a valid integer. and it recalls the problem of error suppressing once again -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.

Re: [SQL] How to select text field as interger

2010-06-29 Thread Tom Lane
Tim Landscheidt writes: > Jerrel Kemper wrote: >> How can I have the same result set as above >> Name >> 001 >> 01 >> 1 >> with the name field defined as character varying. > Ah! Your excentric formatting and the reference to "serial" > had me wondering if the indentation had any meaning. You

Re: [SQL] How to select text field as interger

2010-06-29 Thread Tim Landscheidt
Jerrel Kemper wrote: > 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 : > IDName > 1 001 > 201 > 3 1 > 411 > Select

[SQL] How to select text field as interger

2010-06-29 Thread Jerrel Kemper
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 : IDName 1 001 201 3 1 411 Select name from test where name = '1'