0

I have a problem with my filter query. it's quite complex (for me at least :) ) So here is a generated query:

select `times`.*, `time_categories`.`name` as `type` from `times` 
    inner join `time_categories` on `times`.`time_category_id` = `time_categories`.`id` 
    where `item_id` in 
    (select `tickets`.`id` from `tickets` 
        where `tickets`.`client_id` = '3fb95c1c65b3aa8e197833bcb3741940') 
    or `item_id` in 
    (select tasks.id from tasks, client_project 
        where tasks.project_id = client_project.project_id 
        and `client_project`.`client_id` = '3fb95c1c65b3aa8e197833bcb3741940') 
    and `times`.`user_id` = 'c4065852240228f25e3272708c7824da' 
    and `times`.`network_id` = '502e43ad71e844b0d502bc9ac60816eb' 
    order by `times`.`start_time` desc

The problem is with the user_id, it returns always a entry, independent which user_id it is set.

It seems like it has something to do with the or 'item_id' in part. when i remove that, it returns right. I have no clue why it don't include the user_id for the query.

can anyone help?

mastercheef85
  • 2,109
  • 3
  • 18
  • 25

0 Answers0