Difference between revisions of "Template:Card query"

From Yugipedia
Jump to: navigation, search
(properly support video game for medium; add "-only" variants for medium values)
(update from sandbox)
Line 196: Line 196:
 
* limit: {{ #var: $query_limit | 50 }}
 
* limit: {{ #var: $query_limit | 50 }}
 
* <abbr title="<nowiki>{{{sort}}}</nowiki>, for sorting the results by property">$query_sort</abbr>: <code>{{ #tag: nowiki  | {{ #var: $query_sort  }} }}</code>
 
* <abbr title="<nowiki>{{{sort}}}</nowiki>, for sorting the results by property">$query_sort</abbr>: <code>{{ #tag: nowiki  | {{ #var: $query_sort  }} }}</code>
* <abbr title="<nowiki>{{{ordering}}}</nowiki>, for ordering the results by values">$query_order</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_order }} }}</code>
+
* <abbr title="<nowiki>{{{order}}}</nowiki>, for ordering the results by values">$query_order</abbr>: <code>{{ #tag: nowiki | {{ #var: $query_order }} }}</code>
 
* <abbr title="results count">$query_count</abbr>: {{ #var: $query_count }}
 
* <abbr title="results count">$query_count</abbr>: {{ #var: $query_count }}
 
}}<!--
 
}}<!--
Line 236: Line 236:
 
           {{ #ifeq: {{ lc: {{{extra_column}}} }} | monster type | 1 }}<!-- replace with "Primary type" or "Secondary type" as appropriate -->
 
           {{ #ifeq: {{ lc: {{{extra_column}}} }} | monster type | 1 }}<!-- replace with "Primary type" or "Secondary type" as appropriate -->
 
   | [[Category:((Card query)) transclusions querying deprecated properties]]
 
   | [[Category:((Card query)) transclusions querying deprecated properties]]
 +
}}{{ #if: {{{extra_column|}}}
 +
  | [[Category:Queries with an extra column]]{{ #ifeq: {{{extra_column}}} | {{{extra_header}}}
 +
    | [[Category:((Card query)) transclusions with an unnecessary extra_header]]
 +
  }}
 +
  | {{ #if: {{{extra_header|}}}
 +
    | [[Category:((Card query)) transclusions with an unnecessary extra_header]]
 +
  }}
 +
}}{{ #if: {{{sort|}}}
 +
  | [[Category:Queries with a custom sort]]
 +
}}{{ #if: {{{order|}}}
 +
  | [[Category:Queries with a custom order]]
 +
}}{{ #if: {{{limit|}}}
 +
  | {{ #iferror: {{ #expr: {{{limit}}} }}
 +
    | [[Category:((Card query)) transclusions with junk limit values]]
 +
    | {{ #ifeq: {{{limit}}} | 50
 +
      | [[Category:((Card query)) transclusions with an unnecessary limit]]
 +
      | [[Category:Queries with a custom limit]]
 +
    }}
 +
  }}
 
}}{{ #if: {{ #pos: {{ #var: $query_query }} | {{!}}{{!}} }}
 
}}{{ #if: {{ #pos: {{ #var: $query_query }} | {{!}}{{!}} }}
 
           {{ #pos: {{ #var: $query_query_lc }} | {{!))}} or {{!((}} }}
 
           {{ #pos: {{ #var: $query_query_lc }} | {{!))}} or {{!((}} }}
Line 244: Line 263:
 
}}{{ #if: {{ #pos: {{ #var: $query_query_lc }} | <q> }}
 
}}{{ #if: {{ #pos: {{ #var: $query_query_lc }} | <q> }}
 
   | [[Category:Queries with subqueries]]
 
   | [[Category:Queries with subqueries]]
}}{{ #if: {{ #pos: {{ #var: $query_query }} | ::! }}
+
}}{{ #if: {{ #pos: {{ #var: $query_query }} | ::~ }}
           {{ #pos: {{ #var: $query_query }} | {{!}}{{!}}! }}
+
          {{ #pos: {{ #var: $query_query }} | {{!}}{{!}}~ }}
 +
           {{ #pos: {{ #var: $query_query }} | ::!~ }}
 +
          {{ #pos: {{ #var: $query_query }} | {{!}}{{!}}!~ }}
 +
  | [[Category:Queries with a like comparator]]
 +
}}{{ #if: {{ #pos: {{ #var: $query_query_lc }} | ::like: }}
 +
          {{ #pos: {{ #var: $query_query_lc }} | {{!}}{{!}}like: }}
 +
          {{ #pos: {{ #var: $query_query_lc }} | ::nlike: }}
 +
          {{ #pos: {{ #var: $query_query_lc }} | {{!}}{{!}}nlike: }}
 +
  | [[Category:Queries with a like comparator]][[Category:Queries using LIKE/NOT LIKE SQL notation]]
 +
}}{{ #if: {{ #pos: {{ #replace: {{ #var: $query_query }} | ::!~ }} | ::! }}
 +
          {{ #pos: {{ #replace: {{ #var: $query_query }} | {{!}}{{!}}!~ }} | {{!}}{{!}}! }}
 
   | [[Category:Queries with a not equal comparator]]
 
   | [[Category:Queries with a not equal comparator]]
 
}}{{ #if: {{ #pos: {{ #var: $query_query }} | ::< }}
 
}}{{ #if: {{ #pos: {{ #var: $query_query }} | ::< }}
Line 251: Line 280:
 
           {{ #pos: {{ #var: $query_query }} | ::≤ }}
 
           {{ #pos: {{ #var: $query_query }} | ::≤ }}
 
           {{ #pos: {{ #var: $query_query }} | ::≥ }}
 
           {{ #pos: {{ #var: $query_query }} | ::≥ }}
          {{ #pos: {{ #var: $query_query }} | ::~ }}
 
 
           {{ #pos: {{ #var: $query_query }} | {{!}}{{!}}< }}
 
           {{ #pos: {{ #var: $query_query }} | {{!}}{{!}}< }}
 
           {{ #pos: {{ #var: $query_query }} | {{!}}{{!}}> }}
 
           {{ #pos: {{ #var: $query_query }} | {{!}}{{!}}> }}
 
           {{ #pos: {{ #var: $query_query }} | {{!}}{{!}}≤ }}
 
           {{ #pos: {{ #var: $query_query }} | {{!}}{{!}}≤ }}
 
           {{ #pos: {{ #var: $query_query }} | {{!}}{{!}}≥ }}
 
           {{ #pos: {{ #var: $query_query }} | {{!}}{{!}}≥ }}
          {{ #pos: {{ #var: $query_query }} | {{!}}{{!}}~ }}
 
 
   | [[Category:Queries with comparators]]
 
   | [[Category:Queries with comparators]]
 
}}<noinclude>
 
}}<noinclude>
 
{{Documentation}}</noinclude>
 
{{Documentation}}</noinclude>

Revision as of 03:31, 13 May 2019

SQLStore debug output
ASK Query
SQL Query
SELECT DISTINCT
  t0.smw_id AS id,
  t0.smw_title AS t,
  t0.smw_namespace AS ns,
  t0.smw_iw AS iw,
  t0.smw_subobject AS so,
  t0.smw_sortkey AS sortkey, t0.smw_sort,
  t0.smw_title,
  t0.smw_subobject
FROM
  `smw_object_ids` AS t0
WHERE
  t0.smw_iw!=':smw'
  AND t0.smw_iw!=':smw-redi'
  AND t0.smw_iw!=':smw-border'
  AND t0.smw_iw!=':smw-intprop'
ORDER BY
  t0.smw_sort ASC,
  t0.smw_title ASC,
  t0.smw_subobject ASC
LIMIT
  55
OFFSET
  0
SQL Explain
IDselect_typetabletypepossible_keyskeykey_lenrefrowsExtra
1SIMPLEt0ALLsmw_iw,smw_iw_25101899Using where; Using filesort
Auxilliary Tables
No auxilliary tables used.
Query Metrics
Query-Size:0
Query-Depth:0
Errors and Warnings
The query description has an empty condition.

The query description has an empty condition.

  • #ask query:
  • $query_query:
  • $query_query_lc:
  • $query_medium:
  • $query_medium_query:
  • $query_query_medium:
  • $query_card_type:
  • $query_card_type_query:
  • $query_col_card_type: ?Card type =
  • $query_col_primary_type:
  • $query_col_secondary_type:
  • $query_col_attribute:
  • $query_col_type:
  • $query_col_stars:
  • $query_col_scale:
  • $query_col_link_rating:
  • $query_col_atk:
  • $query_col_def:
  • $query_col_card_type_st: ?Card type = [[Card type]]
  • $query_col_property: ?Property = [[Property]]
  • {{{extra_column}}}:
  • {{{extra_label}}}:
  • $query_col_extra:
  • limit: 50
  • $query_sort: #
  • $query_order:
  • $query_count: 0