Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 281
  • Last Modified:

View and Grouping


I have created a view in SQL that contains a rather complex query.
The query contains a cople of tables, joins etc and grouping

The problem is that it's just one field called ExecutionDate that i don't want for grouping or result
the only thing i want to do is a selection on it.

The problem is when i use the view from a query or from qrystal reports, i can not do a selection on that field since it is not in the views select statement.

How ever inside the view, createing a where clause is no problem

Any ideas?
1 Solution
Patrick MatthewsCommented:
Hello MrHswede,

If you want that column included in the view, then you must include it in the SELECT clause for the view.

Further, since your view has a GROUP BY clause, that column must either be in the GROUP BY clause as
well, or used in an aggregate expression in the SELECT clause.



Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now