How to add UNION with pagination in drupal 7 query? My query is like :

$query_club = db_select('club_members','cm');
$query_club-&gt;fields('cm',array('first_name','last_name'));
$query_club-&gt;group_by('cm.uid');

$query_network = db_select('network_members','nm');
$query_network-&gt;fields('nm',array('first_name','last_name'));
$query_network-&gt;group_by('nm.uid');

$query_club-&gt;union($query_network, 'UNION');
$result = $query_club-&gt;execute()-&gt;fetchAll();


And its giving me correct result.

I want to add here pagination, 

$query_club = $query_club-&gt;extend('PagerDefault')-&gt;extend('TableSort');


But its not working. Can any one help me out
I got the solution. I added this whole query as in subquery like,

$query_club = db_select('club_members','cm');
$query_club-&gt;fields('cm',array('first_name','last_name'));
$query_club-&gt;group_by('cm.uid');

$query_network = db_select('network_members','nm');
$query_network-&gt;fields('nm',array('first_name','last_name'));
$query_network-&gt;group_by('nm.uid');

$query_club-&gt;union($query_network, 'UNION');

**$query_pagination = db_select($query_club,'club_network')-&gt;fields('club_network');
$query_pagination = $query_pagination-&gt;extend('PagerDefault')-&gt;extend('TableSort');
$query_pagination-&gt;limit(10)-&gt;orderByHeader($header);**

$result = $query_pagination-&gt;execute()-&gt;fetchAll();


And using custom form table $form['pager'] = array('#markup' =&gt; theme('pager'));
pagination working fine now