bigup401 has asked for the wisdom of the Perl Monks concerning the following question:
Am trying to use DISTINCT clause to get all ages for users named john +, but dont know why am getting single resluts | TABLE USERS | +--------+-------------------+ | ID | NAMES | AGE | +--------+----------|--------+ | 1 | John | 35 | | 2 | Mike | 31 | | 3 | John | 56 | +--------+-------------------+ my $get_age = $DBH->prepare("SELECT DISTINCT AGE FROM USERS WHERE NAME +S = ?"); $get_age->execute('John'); $age = $get_age->fetchrow(); Am only getting Age 35 for john, but i want to get all ages for users named john
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: fetch all data
by hdb (Monsignor) on Mar 17, 2019 at 15:11 UTC | |
|
Re: fetch all data
by stevieb (Canon) on Mar 17, 2019 at 15:13 UTC | |
by bigup401 (Pilgrim) on Mar 17, 2019 at 15:54 UTC | |
by poj (Abbot) on Mar 17, 2019 at 16:22 UTC | |
by stevieb (Canon) on Mar 17, 2019 at 16:24 UTC | |
by bigup401 (Pilgrim) on Mar 17, 2019 at 18:04 UTC | |
by poj (Abbot) on Mar 17, 2019 at 18:23 UTC | |
|