MySQL with JOIN-Query -
i want connect differend queries each other, can't figure out way how...
table mcr_versions contains list of plugin versions, want plugin_id of last 10 updates:
select plugin_id mcr_versions order time desc limit 10
at next step need plugin table:
select id, name, logo, rating mcr_plugins id = plugin_id
now have table containing plugin-category-relationships, plugin_id , cat_id, want 1 cat_id each plugin:
select cat_id mcr_plugin_cat plugin_id = id
the last table contains name of category:
select name mcr_categories id = cat_id
how can connect these queries 1 query?
select mcr_categories.name mcr_versions left join mcr_plugins on mcr_plugins.id = mcr_versions.plugin_id left join plugin-category-relationships on plugin-category-relationships.plugin_id = mcr_versions.plugin_id left join mcr_categories on mcr_categories.cat_id = plugin-category-relationships.cat_id order mcr_versions.time desc limit 10;
i may wrong @ of tables , beleive u got point
Comments
Post a Comment