Re: Wired behaviour from SELECT - Mailing list pgsql-general

From Arbol One
Subject Re: Wired behaviour from SELECT
Date
Msg-id BYAPR12MB2808B1C3833C91B68FEF9D8ABA2C2@BYAPR12MB2808.namprd12.prod.outlook.com
Whole thread Raw
In response to Re: Wired behaviour from SELECT  ("David G. Johnston" <david.g.johnston@gmail.com>)
List 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 [ í ]

pgsql-general by date:

Previous
From: David Mullineux
Date:
Subject: Re: Wired behaviour from SELECT
Next
From: Arbol One
Date:
Subject: Re: Wired behaviour from SELECT