Created
January 27, 2024 15:55
-
-
Save MjHead/28629842ce6455aed80dc3c7d8228357 to your computer and use it in GitHub Desktop.
JetEngine. SQL query to get appointments with service name and service category name. Replace product_cat with your actual taxonomy slug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT app.*, posts.post_title AS service_name, terms.name AS service_category | |
FROM {prefix}jet_appointments AS app | |
INNER JOIN {prefix}posts AS posts ON posts.ID = app.service | |
INNER JOIN {prefix}term_relationships AS terms_rel ON posts.ID = terms_rel.object_id | |
INNER JOIN {prefix}term_taxonomy AS term_tax ON terms_rel.term_taxonomy_id = term_tax.term_taxonomy_id | |
INNER JOIN {prefix}terms AS terms ON term_tax.term_id = terms.term_id | |
WHERE term_tax.taxonomy = 'product_cat' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment