# |
Apr 27th 2017, 14:37 |
inoas |
https://gist.github.com/inoas/96f13acb90ec173d7d2b534211a008e1#file-sql-sql-L4-L5 |
# |
Apr 27th 2017, 14:37 |
inoas |
instead of creating a virtual table |
# |
Apr 27th 2017, 14:37 |
inoas |
thats what I am building, and everything is / was correct aside the inner JOIN ... there it just puts all the where conditions as ON conditions |
# |
Apr 27th 2017, 14:36 |
inoas |
okay so innerJoin it should be eh |
# |
Apr 27th 2017, 14:36 |
inoas |
I was trying like this https://gist.github.com/inoas/e55bfdc5f7ba0eb4a4b4e17ba79e9428 |
# |
Apr 27th 2017, 14:35 |
dakota |
That normally works better by using innerJoin directly |
# |
Apr 27th 2017, 14:34 |
inoas |
e.g. like a group - finding siblings |
# |
Apr 27th 2017, 14:34 |
inoas |
I want to do a self join on a sub part of the primary key |
# |
Apr 27th 2017, 14:34 |
dakota |
innerJoinWith is for associations, so it would probably work if you declared an association for the virtual table |
# |
Apr 27th 2017, 14:33 |
inoas |
only possible via innerJoin()? |
# |
Apr 27th 2017, 14:33 |
inoas |
anyone knows how to innerJoinWith a virtual table? |
# |
Apr 27th 2017, 14:18 |
megan |
Lurdekan, everyone is here voluntarily :slightly_smiling_face: Be kind to those around us <3 |
# |
Apr 27th 2017, 14:18 |
Lurdekan |
megan: such an awesome member that can't even take a hint |
# |
Apr 27th 2017, 14:18 |
Lurdekan |
megan: My question wasn't stupid, pointless or obnoxious |
# |
Apr 27th 2017, 14:17 |
Lurdekan |
megan: He was just patronizing, didn't properly read the question, nor did understand it. He should have at least asked for more info before tolding me to repeat pointless steps |
# |
Apr 27th 2017, 14:15 |
megan |
lurdekan, Neon1024 was just trying to be helpful and he is a super awesome community member! :slightly_smiling_face: Never hurts to check the docs again or to try google/SO again or wait to see if there is anyone else who may have a different answer |
# |
Apr 27th 2017, 14:14 |
Lurdekan |
megan: It's the typical kind of kid that doesn't even properly reads the question before answering |
# |
Apr 27th 2017, 14:13 |
Lurdekan |
megan: he told me to check docs. that isn't helpful, I clearly said I checked all the docs |
# |
Apr 27th 2017, 14:11 |
megan |
Lurdekan - maybe also post a question on discourse and if someone else maybe has a better answer for you they can post it there (that may not be online atm) |
# |
Apr 27th 2017, 14:11 |
Lurdekan |
Neon1024: I had done that already |
# |
Apr 27th 2017, 14:11 |
Lurdekan |
Neon1024: Telling someone to check the docs again, looking at the debugkit, or the source code is also being a dickhead |
# |
Apr 27th 2017, 14:11 |
megan |
Thanks for helping Neon1024 |
# |
Apr 27th 2017, 14:10 |
Neon1024 |
!askhole |
# |
Apr 27th 2017, 14:10 |
Neon1024 |
Geez. |
# |
Apr 27th 2017, 14:10 |
Neon1024 |
I’m trying. |
# |
Apr 27th 2017, 14:10 |
Neon1024 |
Jut because you don’t like the answer dont’ throw it in my face |
# |
Apr 27th 2017, 14:10 |
Neon1024 |
I tried to help |
# |
Apr 27th 2017, 14:10 |
Neon1024 |
Don’t be a dickhead. |
# |
Apr 27th 2017, 14:10 |
Neon1024 |
Fuck off |
# |
Apr 27th 2017, 14:10 |
Lurdekan |
Neon1024: If you don't understand the question, nor have the answer, don't bother replying |
# |
Apr 27th 2017, 14:09 |
Neon1024 |
->sql() |
# |
Apr 27th 2017, 14:09 |
sms82ar |
Neon, declaring my own index worked. Thanks a lot! |
# |
Apr 27th 2017, 14:09 |
Neon1024 |
No idea then, good luck. |
# |
Apr 27th 2017, 14:09 |
Lurdekan |
Neon1024: But I wanted to do with one |
# |
Apr 27th 2017, 14:09 |
Lurdekan |
Neon1024: I explicitly said that I can do that with 2 queries |
# |
Apr 27th 2017, 14:09 |
Neon1024 |
If you’re trying to pre-optimise before you have code which works, then you’re wasting your own time |
# |
Apr 27th 2017, 14:09 |
Lurdekan |
Neon1024: that still leaves me with 2 queries |
# |
Apr 27th 2017, 14:09 |
Neon1024 |
So do that first |
# |
Apr 27th 2017, 14:08 |
Lurdekan |
Neon1024: In this case the parameter was not fetched yet |
# |
Apr 27th 2017, 14:08 |
Neon1024 |
->find(‘published’, [‘date’ => $date]) |
# |
Apr 27th 2017, 14:08 |
Neon1024 |
I usually just pass the array that I need |