Latest EE.
{pagination}
{pagination_links}
{/pagination_links}
{/pagination}
The inner pagination links pair is not parsed when used inside the query module, here is my template:
{exp:query limit="10" paginate="bottom" sql="SELECT title, url_title, comment_total, view_count_one, recent_comment_date, allow_comments, name FROM exp_channel_titles LEFT JOIN exp_comments ON exp_comments.comment_date = exp_channel_titles.recent_comment_date WHERE exp_channel_titles.channel_id = '38' AND comment_total > '0' ORDER BY recent_comment_date DESC"}
{if count == 1}
<table class="table">
<tbody>
{/if}
<tr>
<td><a href="http://{path=title={title}">{title} ({comment_total})</a> {if allow_comments == n} <i class="icon-lock"></i> <span>small>Answered</small></span>{/if} {if sticky == 'y'}<i class="icon-bookmark"></i> {/if}</td>
<td class="hidden-phone"><i class="icon-comment"></i> {comment_total} {if count == "1"}replies{/if}</td>
<td class="hidden-phone"><i class="icon-eye-open"></i> 4 {if count == "1"}views{/if}</td>
<td class="hidden-phone">
{name}
</td>
<td class="hidden-phone">{recent_comment_date format="%g:%i %A"}</td>
</tr>
{if count == total_results}
</tbody>
</table>
{/if}
{paginate}
{pagination_links}
<ul>
{first_page}
<li><a href="http://{pagination_url}" class="page-first">First Page</a></li>
{/first_page}
{previous_page}
<li><a href="http://{pagination_url}" class="page-previous">Previous Page</a></li>
{/previous_page}
{page}
<li><a href="http://{pagination_url}" class="page-{pagination_page_number} {if current_page}active{/if}">{pagination_page_number}</a></li>
{/page}
{next_page}
<li><a href="http://{pagination_url}" class="page-next">Next Page</a></li>
{/next_page}
{last_page}
<li><a href="http://{pagination_url}" class="page-last">Last Page</a></li>
{/last_page}
</ul>
{/pagination_links}
{/paginate}
{/exp:query}The output is attached.
Is this a bug? In the docs (http://ellislab.com/expressionengine/user-guide//modules/query/index.html#pagination) it says All variables and parameters used by the Channel and Comment Pagination are available for the Query module as well. So, you can specify where to put the pagination links and what type of pagination links to show.
Best wishes
Lee