in reply to Class::DBI 'distinct' records

Your question is a little confusing. Are you asking how to write a query with "DISTINCT" in it, or how to get the value back from a search that you know will only have one result?

Replies are listed 'Best First'.
Re: Re: Class::DBI 'distinct' records
by grazer (Sexton) on Oct 21, 2003 at 17:19 UTC
    Neither. I was hoping that there was a Class::DBI mechanism that would return only 'distinct' values without having to either:

    a) filter the results of a Package->retrieve_all;

    -or-

    b) write a

    Foo->set_sql(distinct => 'SELECT DISTINCT...')
    ...for any class that needs this functionality. I hope I am being clear this time. -Thanks
      I think the consensus is that there isn't a distinct() method. Why don't you write one and contribute back?

      ------
      We are the carpenters and bricklayers of the Information Age.

      The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

      ... strings and arrays will suffice. As they are easily available as native data types in any sane language, ... - blokhead, speaking on evolutionary algorithms

      Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

        I think you are right, it just seemed to me to be such a glaring ommission in an apparently popular module, I assumed that I had to be overlooking something.

        I think I will hack on my local copy and see what I come up with. Thanks for the replies.