Skip to main content

WHERE/GROUP/ORDER Statements Support

No raw SQL. No guesswork. Just clear, visual logic turned into solid, secure model code

What It Does
JCBโ€™s Dynamic GET Builder supports full SQL-like query control without writing any raw SQL. Using the GUI, you can:

  • Filter data rows using conditional WHERE logic
  • Aggregate values across groups with GROUP BY
  • Sort results using ORDER BY (ascending or descending)

These settings are applied to the compiled model code for any view (Site or Custom Admin) that uses the selected GET. The generated PHP uses Joomlaโ€™s query builder API and produces safe, optimized, and Joomla-native queries.

Supported Features

  • ๐ŸŽฏ WHERE Clauses
    • Build logical conditions using fields, operators, and values (e.g. status = 'published')
    • Stack multiple WHERE statements with AND/OR logic
    • Combine across joined tables and nested fields
  • ๐Ÿงฎ GROUP BY Aggregation
    • Group records based on one or more fields
    • Useful for counts, rollups, or statistical summaries
  • ๐Ÿ“Š ORDER BY Sorting
    • Apply single or multi-column sorting
    • Choose ascending or descending for each column

Where to Configure

  1. Navigate to the Dynamic GETs entity in JCB
  2. Create or edit a Dynamic GET
  3. Under the tabs:
    • Use โ€œFilterโ€ for WHERE
    • Use โ€œGroupโ€ for GROUP BY
    • Use โ€œOrderโ€ for ORDER BY
  4. Save and assign the GET to a view

Example Use Cases

  • Show only active users: WHERE `status` = 'active'
  • List products by category then price: GROUP BY `category`, ORDER BY `price` ASC
  • Filter logs by user ID and date range: WHERE `user_id` = X AND `created` > '2024-01-01'

Benefits

  • โœ… Total control over data filtering and presentation
  • ๐Ÿง  Query logic fully visible and editable in GUI
  • ๐Ÿ” No direct SQL exposure โ€” safer and Joomla-native
  • ๐Ÿ”„ Works across multiple views and contexts
  • ๐Ÿ”ง Simplifies custom dashboards, reporting, filtering

Conclusion

With WHERE, GROUP BY, and ORDER BY support built into Dynamic GETs, JCB lets you shape your data output to match your interface needs precisely. No raw SQL. No guesswork. Just clear, visual logic turned into solid, secure model code.