Re: doesn't recognize "!=-" (not equal to a negative value)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Paul Tilles <Paul(dot)Tilles(at)noaa(dot)gov>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: doesn't recognize "!=-" (not equal to a negative value)
Date: 2006-07-11 20:34:07
Message-ID: 5758.1152650047@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Paul Tilles <Paul(dot)Tilles(at)noaa(dot)gov> writes:
> UPDATE tablename SET value = 0.0 where value!=-9.4;
> ERROR: operator does not exist: smallint !=- integer
> HINT: No operator matches the given name and argument type(s). You may
> need to add explicit type casts.

This is not a bug, this is a feature.

Put a space between, or else use the SQL-standard spelling of not-equals,
ie <>

UPDATE tablename SET value = 0.0 where value!= -9.4;
UPDATE tablename SET value = 0.0 where value<>-9.4;

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tim Hart 2006-07-11 20:41:30 Re: doesn't recognize "!=-" (not equal to a negative value)
Previous Message Paul Tilles 2006-07-11 20:26:41 Re: doesn't recognize "!=-" (not equal to a negative value)