in the sessions post type I have a meta field called “session-length” that has a numerical value.
I also have a meta field called “associated-tutor” that is also numerical and contains the post id of the associated tutor post.
i’d like to create a table that lists all the tutor posts, and a sum of all the “session-length” values for all “sessions” posts containing that tutor post id.
To create a table like this, you would need to prepare a custom SQL query, but if you're not that good with SQL, you can use our WordPress database query constructor.
Please note: this tool is not an ultimate query generator. It simply constructs a suggestion of a query. We are constantly working to improve it, but SQL is such a complicated and flexible language that full automation for constructing queries is next to impossible. Consequently, the more complicated the query, the higher is the probability that it will not return exactly what you need. So, you will often need to play around with the resulting query.
Please be advised that preparing MySQL queries for you is not included in the plugin support.
hi Alexander, thanks for your response. I’ve tried multiple different queries, as soon as I add a second post type to join I get errors.
also, even a very basic query from a single post type (post_id and post_title) displays a preview fine, but gives me server error 500 when i try to create it.
If you can show me what you're trying to do, and provide me with a temporary wp-admin user (administrator) I can try and replicate the issue, and maybe help you out with the query.
I can't guarantee anything though, as SQL query support is not included in the support for the plugin.
Hi there. I have 2 custom post types:
Tutors
Sessions
in the sessions post type I have a meta field called “session-length” that has a numerical value.
I also have a meta field called “associated-tutor” that is also numerical and contains the post id of the associated tutor post.
i’d like to create a table that lists all the tutor posts, and a sum of all the “session-length” values for all “sessions” posts containing that tutor post id.
Hello Justen
Thank you for your purchase.
To create a table like this, you would need to prepare a custom SQL query, but if you're not that good with SQL, you can use our WordPress database query constructor.
Please note: this tool is not an ultimate query generator. It simply constructs a suggestion of a query. We are constantly working to improve it, but SQL is such a complicated and flexible language that full automation for constructing queries is next to impossible. Consequently, the more complicated the query, the higher is the probability that it will not return exactly what you need. So, you will often need to play around with the resulting query.
Please be advised that preparing MySQL queries for you is not included in the plugin support.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
hi Alexander, thanks for your response. I’ve tried multiple different queries, as soon as I add a second post type to join I get errors.
also, even a very basic query from a single post type (post_id and post_title) displays a preview fine, but gives me server error 500 when i try to create it.
Hi again Justen
If you can show me what you're trying to do, and provide me with a temporary wp-admin user (administrator) I can try and replicate the issue, and maybe help you out with the query.
I can't guarantee anything though, as SQL query support is not included in the support for the plugin.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables