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

From David Mullineux
Subject Re: Wired behaviour from SELECT
Date
Msg-id CAGsyd8WU_FsAJ-DJ0+54iBoJKRWTfVphShHVSig8hcz=7pi4aA@mail.gmail.com
Whole thread Raw
In response to Re: Wired behaviour from SELECT  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
Instead of nickname you probably want tontet where password=`Arbol'  ..  or am.i.missong something ?.

On Fri, 22 Nov 2024, 20:13 David G. Johnston, <david.g.johnston@gmail.com> 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.

pgsql-general by date:

Previous
From: Eric Hanson
Date:
Subject: Re: Fwd: A million users
Next
From: Arbol One
Date:
Subject: Re: Wired behaviour from SELECT