Re: Wired behaviour from SELECT

Arbol One <arbolone@hotmail.ca>

From: Arbol One <ArbolOne@hotmail.ca>
To: PostGreSQL MailingList <pgsql-general@postgresql.org>, "pgsql-general@lists.postgresql.org" <pgsql-general@lists.postgresql.org>
Cc: "David G. Johnston" <david.g.johnston@gmail.com>
Date: 2024-11-23T09:47:48Z
Lists: pgsql-general
Oops!
I am putting too many hours in front of the computer, better take a break 😳

On 2024-11-22 3:12 p.m., David G. Johnston wrote:
> On Fri, Nov 22, 2024 at 1:07 PM Arbol One <arbolone@hotmail.ca> wrote:
>
>     The below sql statement produces the right output
>     SELECT nickname, password FROM password WHERE id='0938105618107N1';
>       nickname   | password
>     -------------+----------
>      Piccard@@21 |  Arbol
>     (1 row)
>     However, if this sql statement produces the wrong output
>     *SELECT nickname, password FROM password WHERE nickname='Arbol';
>      nickname | password
>     ----------+----------
>     (0 rows)*
>     What am I doing wrong?
>
> Naming a column in your table the same name as the table is 
> problematic generally.  As for the query, if they are both intended to 
> return the same row the value Arbol is in the password column, not the 
> nickname column.  You seem to have reversed the data for the two columns.
>
> David J.
>
-- 
*/ArbolOne ™/*
Using Fire Fox and Thunderbird.
ArbolOne is composed of students and volunteers dedicated to providing 
free services to charitable organizations.
ArbolOne's development on Java, PostgreSQL, HTML and Jakarta EE is in 
progress [ í ]