Skip to main content
Views are virtual tables based on query results.

Basic Syntax

Create View

View with Columns

View with Aggregation

Views with COUNT(*) require native SQL. Use SUM, AVG, MIN, MAX with OmniQL views.

Query a View

Views are queried like regular tables.

Alter View

Update an existing view definition.

Drop View

Complete Examples

Active Premium Users

Low Stock Products

Revenue by Status

Limitations

Current view implementation supports:
  • Simple SELECT queries with WHERE, ORDER BY, LIMIT
  • Column selection
  • Aggregations with SUM, AVG, MIN, MAX
Not currently supported in OmniQL views:
  • COUNT(*) aggregations (use native SQL)
  • Views with JOINs (use native SQL)
  • Materialized views (PostgreSQL-specific, use native SQL)
  • CREATE OR REPLACE (use ALTER VIEW instead)

MongoDB Note

MongoDB does not support traditional views. Use aggregation pipelines or read-only collections for similar functionality.

Next Steps

Indexes

Optimize query performance

Transactions

Group operations safely