Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

DBI: select distinct returns same values

by tukusejssirs (Beadle)
on Sep 21, 2019 at 10:45 UTC ( #11106471=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    mydb=# select distinct cast(date as date) from myschema.mytable;
    -[ RECORD 1 ]-----------
    ...
    date        | 2019-09-20
    -[ RECORD 3 ]-----------
    date        | 2019-09-19
    
  2. or download this
    $sth_dates_uniq = $dbh->prepare("select distinct cast(date as date) fr
    +om myschema.mytable;") or die;
    $sth_dates_uniq->execute();
    ...
    2019-09-19
    2019-09-19
    2019-09-19
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://11106471]
Approved by haukex
Front-paged by haukex
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2020-11-30 18:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?