Title: Viewing a record after using SQL
Last modified: August 21, 2016

---

# Viewing a record after using SQL

 *  [lor342](https://wordpress.org/support/users/lor342/)
 * (@lor342)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/viewing-a-record-after-using-sql/)
 * I need to filter data, and have to use a SQL statement rather than the simpler
   table=”tablename”. Unless there is some way to filter the table?
 * [abase table=”services” order=”Name” columns=”Name,ShortIntro,ContactNumber,Category”
   rlink=”Name,page_id=123″]
 * I have a second page (page_id 123) to display the detail of the record selected
   from the list view. I did this with this command:
 * [abase table=”services” fields=”Name,ShortIntro,ContactNumber,Category”]
 * All works fine, until I change the list view to:
 * [abase sql=”SELECT Name,ShortIntro,ContactNumber,Category FROM services WHERE
   Category=’Sport'” order=”Name” columns=”Name,ShortIntro,ContactNumber,Category”
   rlink=”Name,page_id=123″]
 * In the SQL version, no data is returned on page 123. I tried changing the table
   =”services” to my SQL statement, but that didn’t work either…
 * Help!
 * [https://wordpress.org/plugins/abase/](https://wordpress.org/plugins/abase/)

Viewing 1 replies (of 1 total)

 *  [Loulou51](https://wordpress.org/support/users/loulou51/)
 * (@loulou51)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/viewing-a-record-after-using-sql/#post-4605308)
 * Try this code :
    [abase sql=”SELECT Name,ShortIntro,ContactNumber,Category FROM
   services WHERE Category=’Sport’ ORDER BY Name ” rlink=”Name,page_id=123″]
 * Fields define in the SELECT clause are equivalent to colums=”….”
    The ORDER clause
   in SQL request replace order=”Name”

Viewing 1 replies (of 1 total)

The topic ‘Viewing a record after using SQL’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/abase.svg)
 * [ABASE](https://wordpress.org/plugins/abase/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/abase/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/abase/)
 * [Active Topics](https://wordpress.org/support/plugin/abase/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/abase/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/abase/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Loulou51](https://wordpress.org/support/users/loulou51/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/viewing-a-record-after-using-sql/#post-4605308)
 * Status: not resolved