pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Theodore Petrosky <tedpet5@yahoo.com>
To: postgres SQL <pgsql-sql@postgresql.org>
Subject: please help me with text cast to int ....
Date: Sun, 11 Jul 2004 09:22:46 -0700 (PDT)
Message-ID: <20040711162246.34618.qmail@web41004.mail.yahoo.com> (raw)

I give up.. what don't I understand about casting and
ints and text..  

i have a table jobinfo with:

acode text,
jobnumber text default
nextval('public.jobinfo_seq'::text),
jobtitle text

I have about 3000 rows starting with jobnumber = 1000.

SELECT jobnumber, jobtitle FROM jobinfo WHERE
jobnumber >= 999 ORDER BY jobnumber ASC;

The above SQL produces no rows. however...

SELECT jobnumber, jobtitle FROM jobinfo WHERE
jobnumber >= 200 ORDER BY jobnumber ASC;

produces rows with jobnumber >= 2000

if I change the query with jobnumber >= 201, I get
rows >= 2010.

it is as if there was a silent zero being appended to
the end of my int in the query. What am I missing,
please.

select version();
                                                      
  version                                             
           
-------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 7.4.2 on powerpc-apple-darwin7.3.0,
compiled by GCC gcc (GCC) 3.3 20030304 (Apple
Computer, Inc. build 1495)
(1 row)

Ted


	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 



view thread (4+ messages)  latest in thread

Message-ID: <20040711162246.34618.qmail@web41004.mail.yahoo.com>
Permalink:  ../20040711162246.34618.qmail@web41004.mail.yahoo.com/
Also on:    postgresql.org/message-id/20040711162246.34618.qmail@web41004.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tedpet5@yahoo.com
  Subject: Re: please help me with text cast to int ....
  In-Reply-To: <20040711162246.34618.qmail@web41004.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox