Test query d: Difference between revisions
No edit summary |
No edit summary |
||
Line 15: | Line 15: | ||
|?states/cities/longitude | |?states/cities/longitude | ||
|format=datatable | |format=datatable | ||
|debug= | |debug=true | ||
}} | }} | ||
Line 32: | Line 32: | ||
|?states/cities/latitude | |?states/cities/latitude | ||
|format=datatable | |format=datatable | ||
|debug= | |debug=true | ||
}} | }} | ||
Line 53: | Line 53: | ||
|format=json | |format=json | ||
|pagetitle-name=article | |pagetitle-name=article | ||
|debug= | |debug=true | ||
}} | }} | ||
Line 71: | Line 71: | ||
|?states/state_code | |?states/state_code | ||
|format=table | |format=table | ||
|debug= | |debug=true | ||
}} | }} | ||
Line 94: | Line 94: | ||
|limit=50 | |limit=50 | ||
|format=datatable | |format=datatable | ||
|debug= | |debug=true | ||
}} | }} | ||
Revision as of 18:43, 19 October 2024
{{#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
- Demo VisualData 1.0
- New task
- Page upload
- CRUD
- Result formats
- Dependent values
- Geolocation
- Queries
- Query cities (join queries)
- Dynamic catalogue
- Datatable cards
- Nested schemas
- Carousel
- Table mode
- Lua
- Official docs
support & questions: support at topway.it