Git Product home page Git Product logo

Comments (5)

x86demon avatar x86demon commented on June 6, 2024

Hi, @Gawel1
In this case CONCAT must be used.

Group concat is equal to http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html#function_group-concat

from doctrine-extensions.

Gawel1 avatar Gawel1 commented on June 6, 2024

The problem is there can be more than one line :
Example :
a table with :
a | b | c
a | d | e

I want in output : a | [{label1 : b, label2 : c},{label1 : e, label2 : e}] and group_concat works fine for do that.

from doctrine-extensions.

x86demon avatar x86demon commented on June 6, 2024

Please, provide your DQL

from doctrine-extensions.

Gawel1 avatar Gawel1 commented on June 6, 2024

This MYSQL request give the result i want :

SELECT u.email, CONCAT(u.first_name,' ', u.last_name) AS full_name, ur.is_active AS activated_licence, CONCAT('[', GROUP_CONCAT('{report:"',r.label,'", expiration_date:"', ur.expiration_date, '"}'), ']') AS licences FROM user u left join user_report ur ON ur.user_id=u.id left join report r ON ur.report_id=r.id WHERE u.company_id=%d AND u.status = AND u.role != %s GROUP BY u.email ORDER BY u.email;

from doctrine-extensions.

x86demon avatar x86demon commented on June 6, 2024

Hi, @Gawel1
Issue was found and fixed. Thank you for patience

from doctrine-extensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.