Test query d

From Wikisphere
Revision as of 18:43, 19 October 2024 by Admin (talk | contribs)
Jump to navigation Jump to search
       
{{#visualdataquery:[[name::Afghanistan]] [[states/name::Badakhshan]]
|schema=Country  
|?states/cities/name
|?states/cities/latitude
|?states/cities/longitude
|format=datatable  
}} 

SELECT t0.page_id AS `page_id`,t2.value AS `v2`,t3.value AS `v3`,t4.value AS `v4` FROM (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'name' ) `t0` LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/name' ) `t1` ON (((t1.page_id=t0.page_id))) LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/cities/name' ) `t2` ON (((t2.page_id=t0.page_id) AND (LOCATE( t1.path_parent, t2.path_parent ) = 1))) LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_numeric` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/cities/latitude' ) `t3` ON (((t3.page_id=t0.page_id) AND (t2.path_parent = t3.path_parent))) LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_numeric` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/cities/longitude' ) `t4` ON (((t4.page_id=t0.page_id) AND (t3.path_parent = t4.path_parent))) JOIN `page` `page_alias` ON ((page_alias.page_id = t0.page_id)) WHERE t0.schema_id = '3' AND ((t0.value = 'Afghanistan')) AND ((t1.value = 'Badakhshan')) LIMIT 100

{{#visualdataquery:[[name::Afghanistan]]   [[states/name::Badakhshan]] [[states/cities/name::A~]][[states/cities/latitude::36.68333000]] [[states/cities/restaurants/name::bbb]]      
|schema=Country   
|?states/cities/name
|?states/cities/latitude
|format=datatable 
}} 

SELECT t0.page_id AS `page_id`,t2.value AS `v2`,t3.value AS `v3` FROM (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'name' ) `t0` LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/name' ) `t1` ON (((t1.page_id=t0.page_id))) LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/cities/name' ) `t2` ON (((t2.page_id=t0.page_id) AND (LOCATE( t1.path_parent, t2.path_parent ) = 1))) LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_numeric` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/cities/latitude' ) `t3` ON (((t3.page_id=t0.page_id) AND (t2.path_parent = t3.path_parent))) JOIN `page` `page_alias` ON ((page_alias.page_id = t0.page_id)) WHERE t0.schema_id = '3' AND ((t0.value = 'Afghanistan')) AND ((t1.value = 'Badakhshan')) AND ((t2.value LIKE 'A%' ESCAPE '`')) AND ((t3.value = 36.68333)) LIMIT 100

{{#visualdataquery:[[name::Afghanistan]]   [[states/name::Badakhshan]] [[states/cities/name::A~]][[states/cities/restaurants/name::bbb]]      
|schema=Country   
|?states/cities/name
|?states/cities/latitude
|?states/cities/longitude
|format=json 
|pagetitle-name=article 
}} 

SELECT t0.page_id AS `page_id`,GROUP_CONCAT(t0.value SEPARATOR 0x1E) AS `c0`,GROUP_CONCAT(t1.value SEPARATOR 0x1E) AS `c1`,GROUP_CONCAT(t2.path SEPARATOR 0x1E) AS `p2`,GROUP_CONCAT(t2.value SEPARATOR 0x1E) AS `c2`,GROUP_CONCAT(t3.path SEPARATOR 0x1E) AS `p3`,GROUP_CONCAT(t3.value SEPARATOR 0x1E) AS `c3`,GROUP_CONCAT(t4.path SEPARATOR 0x1E) AS `p4`,GROUP_CONCAT(t4.value SEPARATOR 0x1E) AS `c4` FROM (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'name' ) `t0` LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/name' ) `t1` ON (((t1.page_id=t0.page_id))) LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/cities/name' ) `t2` ON (((t2.page_id=t0.page_id) AND (LOCATE( t1.path_parent, t2.path_parent ) = 1))) LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_numeric` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/cities/latitude' ) `t3` ON (((t3.page_id=t0.page_id) AND (t2.path_parent = t3.path_parent))) LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_numeric` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/cities/longitude' ) `t4` ON (((t4.page_id=t0.page_id) AND (t3.path_parent = t4.path_parent))) JOIN `page` `page_alias` ON ((page_alias.page_id = t0.page_id)) WHERE t0.schema_id = '3' AND ((t0.value = 'Afghanistan')) AND ((t1.value = 'Badakhshan')) GROUP BY t0.page_id HAVING ((c2 LIKE 'A%' ESCAPE '`')) LIMIT 100


{{#visualdataquery:[[name::Afghanistan]]
|schema=Country 
|?states/name
|?states/state_code
|format=table 
}}

SELECT t0.page_id AS `page_id`,t1.value AS `v1`,t2.value AS `v2` FROM (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'name' ) `t0` LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/name' ) `t1` ON (((t1.page_id=t0.page_id))) LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/state_code' ) `t2` ON (((t2.page_id=t0.page_id) AND (t1.path_parent = t2.path_parent))) JOIN `page` `page_alias` ON ((page_alias.page_id = t0.page_id)) WHERE t0.schema_id = '3' AND ((t0.value = 'Afghanistan')) LIMIT 100

 
{{#visualdataquery:
[[name::Canada]][[states/name::Q~]]
|schema=Country
|?states/name=State name
|?states/cities/name=City name
|?states/cities/latitude 
|limit=50
|format=datatable 
}}

SELECT t0.page_id AS `page_id`,t1.value AS `v1`,t2.value AS `v2`,t3.value AS `v3` FROM (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'name' ) `t0` LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/name' ) `t1` ON (((t1.page_id=t0.page_id))) LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/cities/name' ) `t2` ON (((t2.page_id=t0.page_id) AND (LOCATE( t1.path_parent, t2.path_parent ) = 1))) LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_numeric` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE schema_id = '3' AND path_no_index = 'states/cities/latitude' ) `t3` ON (((t3.page_id=t0.page_id) AND (t2.path_parent = t3.path_parent))) JOIN `page` `page_alias` ON ((page_alias.page_id = t0.page_id)) WHERE t0.schema_id = '3' AND ((t0.value = 'Canada')) AND ((t1.value LIKE 'Q%' ESCAPE '`')) LIMIT 50


See also


support & questions: support at topway.it

Download the latest version!