Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: DBI: select distinct returns same values

by erix (Prior)
on Sep 21, 2019 at 13:09 UTC ( [id://11106481]=note: print w/replies, xml ) Need Help??


in reply to DBI: select distinct returns same values

The only important column from this table is the datestamp column called date.

Data type 'datestamp' does not exist in PostgreSQL. What's the data type of column 'record_date'? (try \d itens.lbd_w300 in psql)

Replies are listed 'Best First'.
Re^2: DBI: select distinct returns same values
by tukusejssirs (Beadle) on Sep 21, 2019 at 13:24 UTC

    By datestamp I meant timestamp. ;)

    And I tried to use general names for db/schema/table, but have missed some of them. I have just modified the OP to make it more consistent.

    To answer your question: the date/record_date column is of timestamp type.

      I can't get your results. In my hands, I get the distinct values, as expected, also with that little chunk of perl code of yours. If I remove the 'DISTINCT' I get the doubles (I made a 4 row table).

      So you must be overlooking some detail. Maybe you can write up a small but complete) code example (including data) with data (!) that can be run against a postgres database (remove/change the user/password, of course). I expect that while you prepare that, you will see what went wrong.

      (by the way: the Pg don't-do-this page advises against this data type )

      edit: I was mistaken; I probably futzed my own try-out code, but I see you got good answers already so I'll leave it at that.

      I have just modified the OP ...

      Please see How do I change/delete my post? for site etiquette and protocol regarding such changes. Bottom line: Do Not Destroy Context!


      Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11106481]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2024-04-24 22:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found