Monday, March 19, 2012
Group Expression
significance of creating a group in a table where the group on
expression is =1?If you group on an expression like =1, you are grouping on a constant value.
Consequently, you will only get one group at runtime which contains all
data.
A grouping in RDL is similar to what a "group by" in a SQL query is doing -
it is grouping the data into groups based on the grouping value.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Anishya" <anishya@.gmail.com> wrote in message
news:1127286499.682855.101660@.g44g2000cwa.googlegroups.com...
>I have a doubt on group expressions. Can anyone tell me the
> significance of creating a group in a table where the group on
> expression is =1?
>
Friday, March 9, 2012
Group by Restrictions?
Hi, Just a little doubt...
Is any difference or restriction there between using in the group by clause the columns as they are in the select list?
For example when I use an UPPER, CONVERT, etc.
Thanks : )
use pubs
--Case 1
select upper(title), type
from titles
group by upper(title), type
--Case 2
select upper(title), type
from titles
group by (title), type
In your case both the quires will be identical. (Upper & Lower)
When you use convert it may produce a different result..BUT YOU WONT GET ANY ERROR.
See the below sample,
Code Snippet
Create table #Test(
Date datetime,
StkQty int);
Insert into #Test Values('2007-01-01 10:00', 10)
Insert into #Test Values('2007-01-01 11:00', 100)
Insert into #Test Values('2007-01-02 12:00', 17)
Insert into #Test Values('2007-01-02 13:00', 13)
Select
Convert(varchar(10),Date,103)
,Sum(StkQty) as [Sum]
From
#test
Group By
Convert(varchar(10),Date,103)
/*
DateSum
01/01/2007 110
02/01/2007 30
*/
Select
Convert(varchar(10),Date,103)
,Sum(StkQty) as [Sum]
From
#test
Group By
Date
/*
DateSum
01/01/2007 10
01/01/2007 100
02/01/2007 17
02/01/2007 13
*/
|||
Yes I am sorry, it was a bad example. Suppose that I have made a select over some duplicated rows.
I need to make a kind of Catalog and want only distinct values, so as a way to do it I use the Group by Clause. Some times I use to apply "convert char", "case", "upper" over columns. I have seen some cases where Group By clause is showed exactly like the select list but just don't know the meaning.