Title: Table sort and query
Last modified: August 30, 2016

---

# Table sort and query

 *  Resolved [cunnama](https://wordpress.org/support/users/cunnama/)
 * (@cunnama)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/table-sort-and-query/)
 * Hi there,
 * Thanks for a great plugin, I’m having a small issue though. I’m trying to conditionally
   select from a table and then sort, however I don’t seem to be able to do both:
 * [gdoc key=”[https://docs.google.com/spreadsheets/d/1GxC1fLdlrIizC-CZzCi_9x2QQfr8-57-BzPQvXGNcw4/edit?usp=sharing&#8221](https://docs.google.com/spreadsheets/d/1GxC1fLdlrIizC-CZzCi_9x2QQfr8-57-BzPQvXGNcw4/edit?usp=sharing&#8221);
   datatables_order=’%5B%5B 1, “desc” %5D%5D’ query=”select A, B, C where B is not
   null” use_cache=”no”]
 * Gives me the complete table, including null values, sorted.
 * [gdoc key=”[https://docs.google.com/spreadsheets/d/1GxC1fLdlrIizC-CZzCi_9x2QQfr8-57-BzPQvXGNcw4/edit?usp=sharing&#8221](https://docs.google.com/spreadsheets/d/1GxC1fLdlrIizC-CZzCi_9x2QQfr8-57-BzPQvXGNcw4/edit?usp=sharing&#8221);
   query=”select A, B, C where B is not null” datatables_order=’%5B%5B 1, “desc”%
   5D%5D’ use_cache=”no”]
 * Gives me the only the non-null values, unsorted.
 * I tried using “order by” in the query but it is overridden by the html and disabling
   the datatables as below only disables the datatable and ignores the query.
 * [gdoc key=”[https://docs.google.com/spreadsheets/d/1GxC1fLdlrIizC-CZzCi_9x2QQfr8-57-BzPQvXGNcw4/edit?usp=sharing&#8221](https://docs.google.com/spreadsheets/d/1GxC1fLdlrIizC-CZzCi_9x2QQfr8-57-BzPQvXGNcw4/edit?usp=sharing&#8221);
   class=”no-datatables” query=”select A, B, C where B is not null order by B desc”
   use_cache=”no”]
 * Is this expected behaviour?
 * Kind Regards,
    Daniel
 * [https://wordpress.org/plugins/inline-google-spreadsheet-viewer/](https://wordpress.org/plugins/inline-google-spreadsheet-viewer/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [cunnama](https://wordpress.org/support/users/cunnama/)
 * (@cunnama)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/table-sort-and-query/#post-6719328)
 * Well I’m not sure what happened, but you’ll be glad to hear it is now working
   perfectly with datatables on with either order… The cache was off so I’m not 
   sure what changed but there you have it.
 * Great plugin, Thanks,
    Daniel
 *  Plugin Author [Meitar](https://wordpress.org/support/users/meitar/)
 * (@meitar)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/table-sort-and-query/#post-6719350)
 * > it is now working perfectly with datatables on with either order
 * Cool.
 * > The cache was off so I’m not sure what changed but there you have it.
 * Could’ve been a different cache.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Table sort and query’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/inline-google-spreadsheet-viewer.
   svg)
 * [Inline Google Spreadsheet Viewer](https://wordpress.org/plugins/inline-google-spreadsheet-viewer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/inline-google-spreadsheet-viewer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/)
 * [Active Topics](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/reviews/)

## Tags

 * [query](https://wordpress.org/support/topic-tag/query/)
 * [sort](https://wordpress.org/support/topic-tag/sort/)
 * [table](https://wordpress.org/support/topic-tag/table/)

 * 2 replies
 * 2 participants
 * Last reply from: [Meitar](https://wordpress.org/support/users/meitar/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/table-sort-and-query/#post-6719350)
 * Status: resolved