Hi Stefan and Martin,

Thanks all for your feedback.
Thats true, my query isn't very "regular"... I will search on sql forums.

I know at once that this isn't the place for my question, sorry for that.

But, just in case someone has an idea
:

In fact, I have a table with 3 fields : email, address and update_date ( update date of email address, so, there are several addresses for each email)
What I
want to do it's to get
the last address of each email based on the date.

Something like "Select email, first(address) group by email;"

Regards,

Remi




2013/6/28 Martin Kersten <martin@monetdb.org>
Indeed, the standard requires the result to be passed on towards an aggregate.
It shows that in the fringes every DBMS may divert/violate from the standard.
regards, Martin


On 6/28/13 5:44 PM, Rémi Daniel wrote:
Thanks for your reply,

My query works on Mysql but not on MonetDB, thats why I contact this maillist, to know if a specific function exist. (Sql functions aren't all the sames on all DBMS).
(error message of my query : "cannot use non GROUP BY column 'field3' in query results without an aggregate function")

I will continue to search a solution,

Regards,


2013/6/28 Lefteris <lsidir@gmail.com <mailto:lsidir@gmail.com>>


    Dear remi,

    your question is a general SQL question and not a MonetDB specific. MonetDB sql frontend follows the SQL standard so any SQL query that works in any DBMS will work in the same way in MonetDB too.

    If you have questions on how to formulate correct queries in SQL I would advice you to use one of the many SQL references available in the web.

    On the other hand, if you ran a correct SQL query against monetdb and you got an error or incorrect results, meaning a possible bug, then please let us know the error / output of MonetDB and we will help you.

    lefteris


    On Fri, Jun 28, 2013 at 4:05 PM, Rémi Daniel <rdaniel@inbox.fr <mailto:rdaniel@inbox.fr>> wrote:

        Hello,

        I'm a French user of MonetDB, and I have a SQL question,
        I want to execute on MonetDB equivalent of this mysql request, and i don't find any solution :

        "SELECT field1, field2 FROM table GROUP BY field3 LIMIT 5;"

        I want to do a GROUP BY of a field3 which is not in the SELECT to get a limit of request results by this field3, like the "first" function of some databases.

        Does anyone have any idea on how I can do that ?

        Thanks for your help,

        Remi

        --

        <http://inbox.fr>

               


        Rémi Daniel
        Développeur Web rdaniel@inbox.fr <mailto:rdaniel@inbox.fr>


        30, rue Vincent Moris
        92240 Malakoff - France
        Fax : +33 (0)1 55 48 02 79


        _______________________________________________
        users-list mailing list
        users-list@monetdb.org <mailto:users-list@monetdb.org>

        http://mail.monetdb.org/mailman/listinfo/users-list



    _______________________________________________
    users-list mailing list
    users-list@monetdb.org <mailto:users-list@monetdb.org> Rémi Daniel
Développeur Web rdaniel@inbox.fr <mailto:rdaniel@inbox.fr>


30, rue Vincent Moris
92240 Malakoff - France
Fax : +33 (0)1 55 48 02 79



_______________________________________________
users-list mailing list
users-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/users-list


_______________________________________________
users-list mailing list
users-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/users-list



--


Rémi Daniel
Développeur Web rdaniel@inbox.fr

30, rue Vincent Moris
92240 Malakoff - France
Fax : +33 (0)1 55 48 02 79