From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Arbol One <arbolone(at)hotmail(dot)ca> |
Cc: | "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>, PostGreSQL MailingList <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Wired behaviour from SELECT |
Date: | 2024-11-22 20:12:46 |
Message-ID: | CAKFQuwahNdTb3kHWyDGnxkTqD3oH18tS597y3WKv8UdNz5-xhw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Fri, Nov 22, 2024 at 1:07 PM Arbol One <arbolone(at)hotmail(dot)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.
From | Date | Subject | |
---|---|---|---|
Next Message | Ron Johnson | 2024-11-22 20:36:36 | Re: Wired behaviour from SELECT |
Previous Message | Arbol One | 2024-11-22 20:07:10 | Wired behaviour from SELECT |