Difference between revisions of "Semantic MediaWiki/data/smw subs2"
< Semantic MediaWiki | data
Jump to navigation
Jump to search
(Created page with "==About== * '''Version''': 1.7 ==SQL== <mysql>CREATE TABLE `smw_subs2` ( `s_id` int(8) unsigned NOT NULL, `o_id` int(8) unsigned DEFAULT NULL, KEY `s_id` (`s_id`), KEY...") |
(example and hypothesis) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
==About== | ==About== | ||
* '''Version''': 1.7 | * '''Version''': 1.7 | ||
+ | * '''Documentation status''': unofficial; confirmed only by testing | ||
+ | * '''Purpose''': seems to be a mapping of categories and sub-categories | ||
==SQL== | ==SQL== | ||
<mysql>CREATE TABLE `smw_subs2` ( | <mysql>CREATE TABLE `smw_subs2` ( | ||
Line 8: | Line 10: | ||
KEY `o_id` (`o_id`) | KEY `o_id` (`o_id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=binary;</mysql> | ) ENGINE=InnoDB DEFAULT CHARSET=binary;</mysql> | ||
+ | ==Example== | ||
+ | <mysql> | ||
+ | SELECT s_id, o_id | ||
+ | , CAST(s.smw_title AS char) AS s_title | ||
+ | , CAST(o.smw_title AS char) AS o_title | ||
+ | FROM | ||
+ | (smw_subs2 AS x | ||
+ | LEFT JOIN smw_ids AS s ON x.s_id=s.smw_id) | ||
+ | LEFT JOIN smw_ids AS o ON x.o_id=o.smw_id; | ||
+ | </mysql> |
Latest revision as of 19:32, 17 December 2012
About
- Version: 1.7
- Documentation status: unofficial; confirmed only by testing
- Purpose: seems to be a mapping of categories and sub-categories
SQL
<mysql>CREATE TABLE `smw_subs2` (
`s_id` int(8) unsigned NOT NULL, `o_id` int(8) unsigned DEFAULT NULL, KEY `s_id` (`s_id`), KEY `o_id` (`o_id`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;</mysql>
Example
<mysql> SELECT s_id, o_id
, CAST(s.smw_title AS char) AS s_title , CAST(o.smw_title AS char) AS o_title FROM (smw_subs2 AS x LEFT JOIN smw_ids AS s ON x.s_id=s.smw_id) LEFT JOIN smw_ids AS o ON x.o_id=o.smw_id;
</mysql>