select p.id, p.owneruserid, p.communityowneddate from pos...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Drupal Answers Meta

Q&A about the site for Drupal developers and administrators

select p.id, p.owneruserid, p.communityowneddate
from posts p
inner join (
select v.postid, votetypeid
from  votes v 
where votetypeid in (1,2,3,9)
and v.creationdate >= dateadd(##timeframe?yy##, -1,  DATETRUNC(week, getdate()))
) v on v.postid = p.id
/*
select userid, bountyamount
from votes v
where votetypeid = 8 
*/

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results