We help IT Professionals succeed at work.

View and Grouping

Medium Priority
290 Views
Last Modified: 2012-05-06
Hi!

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?
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2010
Commented:
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.

Regards,

Patrick

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.