Log message #4124903

# At Username Text
# Mar 14th 2018, 12:00 narendravaghela how can I achieve the same query with Cake ORM?
# Mar 14th 2018, 12:00 narendravaghela https://stackoverflow.com/questions/28158083/mysql-group-and-total-but-return-all-rows-in-each-group?rq=1
# Mar 14th 2018, 11:59 narendravaghela right, and for that I need subquery
# Mar 14th 2018, 11:58 neon1024 Group will always reduce the size of the result set
# Mar 14th 2018, 11:58 neon1024 If I understand, that’s not possible.
# Mar 14th 2018, 11:58 narendravaghela let me try contain
# Mar 14th 2018, 11:58 narendravaghela and also want all the rows.
# Mar 14th 2018, 11:58 narendravaghela I want to fetch all all entries from a table with group by
# Mar 14th 2018, 11:57 ghoritrilochan shreehariji.com
# Mar 14th 2018, 11:57 neon1024 You can contain the same table as long as it’s alias is unique
# Mar 14th 2018, 11:57 ghoritrilochan https://b4umusic.000webhostapp.com/shreehariji/
# Mar 14th 2018, 11:57 ghoritrilochan hii.. my project live in two different server but one proper work and other in not work plz help..
# Mar 14th 2018, 11:57 narendravaghela contain the same table?
# Mar 14th 2018, 11:57 neon1024 Perhaps you’re looking for `contain()` ?
# Mar 14th 2018, 11:56 neon1024 You can’t, all it does is join tables
# Mar 14th 2018, 11:55 narendravaghela how can I pass fields in `join` method?
# Mar 14th 2018, 11:38 narendravaghela The goal is - find all time log entries with date wise sum
# Mar 14th 2018, 11:37 narendravaghela Got it, I need to prepare array in `join` method
# Mar 14th 2018, 11:36 narendravaghela So, I tried join
# Mar 14th 2018, 11:36 neon1024 https://book.cakephp.org/3.0/en/orm/query-builder.html#subqueries
# Mar 14th 2018, 11:36 narendravaghela I got a subquery solution form stackoverflow to achieve the goal
# Mar 14th 2018, 11:36 neon1024 Join is not the method you need
# Mar 14th 2018, 11:36 neon1024 https://book.cakephp.org/3.0/en/orm/query-builder.html#adding-joins
# Mar 14th 2018, 11:35 narendravaghela The goal is - find all time log entries with date wise sum
# Mar 14th 2018, 11:34 narendravaghela I was pasting the code :slightly_smiling_face:
# Mar 14th 2018, 11:34 narendravaghela https://pastebin.com/LH9L3Z7D
# Mar 14th 2018, 11:34 neon1024 Are you using `join()` ?
# Mar 14th 2018, 11:33 neon1024 That’s a bit of a loaded question, as clearly the join you’re using is important for us to see. Especially as you’ve tried passing a Query where an array is needed. So it’s not giving an error, you’ve used it incorrectly.
# Mar 14th 2018, 11:32 narendravaghela Can we use subquery in joins? It gives an error `Cannot use object of type Cake\ORM\Query as array `
# Mar 14th 2018, 11:25 neon1024 Hm, sounds good! Thanks for the info, I’ll have a try
# Mar 14th 2018, 11:24 dereuromark doesnt miss anything and doesnt seem to have parse issues like regex solutions do
# Mar 14th 2018, 11:23 dereuromark but I tested it and even though its slow it works good.
# Mar 14th 2018, 11:23 dereuromark in that case maybe its own yaml would make sense.
# Mar 14th 2018, 11:23 dereuromark especially since you are only interested in <=3.5 stuff
# Mar 14th 2018, 11:23 dereuromark might be missing a few things, but based on migration guide you could add them
# Mar 14th 2018, 11:23 dereuromark just run it as documented :slightly_smiling_face:
# Mar 14th 2018, 11:22 neon1024 Actually, I’ll make a cup of tea and go through it properly rather than being lazy ;)
# Mar 14th 2018, 11:22 dereuromark no
# Mar 14th 2018, 11:22 neon1024 At a quick glance, I have to create a yaml config for all the changes between my version and the target?
# Mar 14th 2018, 11:20 dereuromark this tool or my upgrade tool (a bit outdated) should do the trick
# Mar 14th 2018, 11:20 dereuromark bottom line: https://www.reddit.com/r/PHP/comments/82ddpt/the_cakephp_core_team_is_excited_to_announce_the/dvaa8kv/