While creating a Timesheet webpart I needed to list a users tasks in a task list. The tip from Martin Hatch gave the basics. and the query executed fine in U2U CAML Query Builder (2007 version works fine for 2010)
<Where>
<Or>
<Eq>
<FieldRef Name='AssignedTo' />
<Value Type='UserMulti'>User Display Name</Value>
</Eq>
<Membership Type='CurrentUserGroups'>
<FieldRef Name='AssignedTo' />
</Membership>
</Or>
</Where>
This query will return users in groups, and multiple users specified in the field:
Note:
The Membership attribute checks current user, so do not run the query with elevated rights (SPSecurity.RunWithElevatedPrivileges(…)
Unless you assign tasks to your application pool the query will not return items based on group assignments