All pastes #576620 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-06-19 15:38 UTC
rendered paste body
SELECT                                 
 obj_uri, MAX(tag_date)                                  
FROM                                        
 tag_it.tag,                                         
tag_it.object,                                         
tag_it.user_app                                 
WHERE                                         
tag_obj_id = obj_id                                        
AND tag_user_app_id = usr_app_id 
AND tag_idx @@ 'google'::tsquery 
AND usr_app_brand = 1  
GROUP BY                                                  
obj_uri                                          
ORDER BY                     
MAX(tag_date) DESC  
OFFSET 0 LIMIT 10;

-----
      SELECT DISTINCT                                
       obj_uri, tag_date                                 
      FROM                                       
       tag_it.tag,                                         
      tag_it.object,                                         
      tag_it.user_app                                 
      WHERE                                         
      tag_obj_id = obj_id                                       
      AND tag_user_app_id = usr_app_id
      AND tag_idx @@ 'google'::tsquery
      AND usr_app_brand = 1 
      ORDER BY                     
      tag_date DESC 
      OFFSET 0 LIMIT 10;