Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > wrong query res...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 15222 of 17602
Post > Topic >>

wrong query result

by jmporres@[EMAIL PROTECTED] ("josep porres") Apr 9, 2008 at 10:20 AM

------=_Part_23746_12147368.1207729218898
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi


I just want to let you know one thing.
By the way, I'm running Postgres 8.3.1 on windows

I was making a query using pgadmin:

select clau, lecact-lecant as m3, m3any, ta, tc, 3 as mesos, persones,
true
as clavegueram
from fac_abonats
where clau in (select clau from tmp_claus_prova)
order by clau

clau is the primary key of the table fac_abonats

the thing is that the result of the query returns the same number of rows
a=
s
the table fac_abonats (thousands).
select clau from tmp_claus_prova return about one hundred rows, and all
the
values in the column exists
in fac_abonats.   So maybe something wrong is happening in the where
clause=
..

At the end I've realized that there is no column named 'clau'. It has
another name.
So the subselect query is wrong, if I execute it alone, an error appears

ERROR:  no existe la columna =ABclau=BB
LINE 6: select clau from tmp_claus_prova
               ^

********** Error **********

ERROR: no existe la columna =ABclau=BB
Estado SQL:42703
Caracter: 188



The question is:
Is it a normal behaviour? Because I think that if the query is wrong,
wouldn't be better to raise an error?



Regards,


Josep ****res

------=_Part_23746_12147368.1207729218898
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi<br><br><br>I just want to let you know one thing. <br>By the way,
I&#39;=
m running Postgres 8.3.1 on windows<br><br>I was making a query using
pgadm=
in:<br><br><span style=3D"font-family: courier new,monospace;">select
clau,=
 lecact-lecant as m3, m3any, ta, tc, 3 as mesos, persones, true as
clavegue=
ram</span><br style=3D"font-family: courier new,monospace;">
<span style=3D"font-family: courier new,monospace;">from
fac_abonats</span>=
<br style=3D"font-family: courier new,monospace;"><span
style=3D"font-famil=
y: courier new,monospace;">where clau in (select clau from
tmp_claus_prova)=
</span><br style=3D"font-family: courier new,monospace;">
<span style=3D"font-family: courier new,monospace;">order by
clau</span><br=
 style=3D"font-family: courier new,monospace;"><br>clau is the primary key
=
of the table fac_abonats<br><br>the thing is that the result of the query
r=
eturns the same number of rows as the table fac_abonats (thousands).<br>
select clau from tmp_claus_prova return about one hundred rows, and all
the=
 values in the column exists<br>in fac_abonats.&nbsp;&nbsp; So maybe
someth=
ing wrong is happening in the where clause.<br><br>At the end I&#39;ve
real=
ized that there is no column named &#39;clau&#39;. It has another
name.<br>
So the subselect query is wrong, if I execute it alone, an error
appears<br=
><br><span style=3D"font-family: courier new,monospace;">ERROR:&nbsp; no
ex=
iste la columna =ABclau=BB</span><br style=3D"font-family: courier
new,mono=
space;"><span style=3D"font-family: courier new,monospace;">LINE 6: select
=
clau from tmp_claus_prova</span><br style=3D"font-family: courier
new,monos=
pace;">
<span style=3D"font-family: courier
new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^</span><br
s=
tyle=3D"font-family: courier new,monospace;"><br style=3D"font-family:
cour=
ier new,monospace;"><span style=3D"font-family: courier
new,monospace;">***=
******* Error **********</span><br style=3D"font-family: courier
new,monosp=
ace;">
<br style=3D"font-family: courier new,monospace;"><span
style=3D"font-famil=
y: courier new,monospace;">ERROR: no existe la columna
=ABclau=BB</span><br=
 style=3D"font-family: courier new,monospace;"><span style=3D"font-family:
=
courier new,monospace;">Estado SQL:42703</span><br style=3D"font-family:
co=
urier new,monospace;">
<span style=3D"font-family: courier new,monospace;">Caracter:
188</span><br=
><br><br><br>The question is: <br>Is it a normal behaviour? Because I
think=
 that if the query is wrong, wouldn&#39;t be better to raise an error?<br>
<br><br><br>Regards,<br><br><br>Josep ****res<br><br>

------=_Part_23746_12147368.1207729218898--
 




 4 Posts in Topic:
wrong query result
jmporres@[EMAIL PROTECTED  2008-04-09 10:20:18 
Re: wrong query result
dev@[EMAIL PROTECTED] (R  2008-04-09 09:32:51 
Re: wrong query result
kleptog@[EMAIL PROTECTED]  2008-04-09 10:39:06 
Re: wrong query result
laurenz.albe@[EMAIL PROTE  2008-04-09 13:37:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 19:13:16 CST 2008.