SQL Result varies when changing "select" statement

Viewed 360

So currently we are doing SQL @ our School and I was wondering about an suspicious result set when changing the select parameters.

So when I try this:

select p1.vorname, p1.Geburtstag, p2.vorname, p2.Geburtstag
from patienten as p1
inner join patienten as p2 
    on p1.Geburtstag = p2.Geburtstag AND p1.Nr != p2.Nr
order by p1.Geburtstag asc

Then I get 44 results. But when I try this:

select p1.vorname, p1.Geburtstag
    from patienten as p1
    inner join patienten as p2 
        on p1.Geburtstag = p2.Geburtstag AND p1.Nr != p2.Nr
    order by p1.Geburtstag asc

I get 1084 results, which represents all the patients...

I'm wondering why, cause all I did was changing the select statement...

I'm using XAMPP:

Server: 127.0.0.1 via TCP/IP
Server-Typ: MariaDB
Server-Version: 10.1.8-MariaDB-log - mariadb.org binary distribution
Protokoll-Version: 10
Benutzer: root@localhost
Server-Zeichensatz: UTF-8 Unicode (utf8)
1 Answers
Related