deja

I'm sorry I misunderstood the results at first. This unfortunately doesn't get the query I desired.

I can't use ->whereColumn('units.location_id', '<>', 'units.castle_id') because it will ignore situations where:

there are 10 units with location_id: 1 and 5 of them have castle_id: 1 and the other 5 have castle_id: 123

I would want these 10 units as part of my results because they are all on the same location_id but there are different owners(castle_id).

Guess I'll be back at it tomorrow after work! Thanks anyways @Snapey

Please sign in or create an account to participate in this conversation.