# Conditions on Joined Tables

**URL:** <https://www.ruby-forum.com/t/conditions-on-joined-tables/184155>\
**Category:** Rails\
**Created:** [February 25, 2010, 6:56pm UTC](https://www.ruby-forum.com/t/conditions-on-joined-tables/184155 "2010-02-25T18:56:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [February 25, 2010, 6:56pm UTC](https://www.ruby-forum.com/t/conditions-on-joined-tables/184155/1 "2010-02-25T18:56:35Z")

</div>

Hi

I don’t see how to write correctly conditions for the following  
query :

association:  
client has\_many :orders

I would to get in one query :

all clients with NO ORDER + clients with orders where Today IS NOT in  
range (order.start\_date… order.end\_date)

is it possible or should I write 2 queries then join the resulting  
arrays ?

thanks

erwin
