title: Using Distinct with joins
body: <p>I created join what gives me around  3 000 000 count(<em>), but I know I only need count(</em>) around 700 000 and that count comes from table cr.OBJ_Daily_Offers odo
  I need to get values by that table PK what is odo.obj_dailyoffers_id.
  what came to my mind is to use distinct, but I dont't know how to get allso count(*) to see if the result is as on daily_offers table.
  My select needs to be somthing like this.</p>
  
  <pre><code>select distinct odo.OBJ_DAILYOFFERS_ID, *
  from cr.obj_daily_offers odo
  join cr.obj_val v
      on v.obj_row_id = odo.schedule_id
  join cr.OBJ_VAL_OBJ_VAL l on l.OBJ_VAL_OBJ_VAL_ID = v.OBJ_VAL_ID
  join cr.OBJ_VAL v1 on v1.OBJ_VAL_ID = l.LINKVALUE_OBJ_VAL_ID
  join cr.OBJ_ROW a on a.OBJ_ROW_ID = v1.OBJ_ROW_ID 
  join cr.OBJ_VAL v2 on v2.OBJ_ROW_ID = v1.OBJ_ROW_ID and v2.OBJ_FIELD_ID = 750 
  join cr.OBJ_VAL v3 on v3.VAL = v2.VAL
  join cr.OBJ_ROW a1 on a1.OBJ_ROW_ID = v3.OBJ_ROW_ID and a1.OBJ_ID = 752 
  join cr.OBJ_VAL v4 on v4.OBJ_ROW_ID = v3.OBJ_ROW_ID and v4.OBJ_FIELD_ID = 810 
  </code></pre>