0 - 10 of 10 tags for group by

Hi Team,
 
Today i am surprised, one of my query is returning duplicate data. I tried to find it with the qroup by, but it didnt picked the duplicate. Excel helped me.
 
All values are same, except case difrrence in one field one has small 'r' and other has 'R'. Group by considered this as unique.
 
Is it correct?

/*
Hi,  I am trying to run the below query, in vain. I was able to get the results by using a different logic.
However I am not able to understand why my query for search didn’t work, while my query for sales worked (they are both essentially the same query with different column names)
*/

Hello All,
I know the functionality of group by function and partition by function. But when i use both the queries in the same query i get an error as Selected non-aggregate must be part of the group.
Below is the query i tried.
SEL
COL1,COL2,COL3,SUM(COL3),
SUM(COL2) OVER (PARTITION BY COL1,COL2,COL3)
FROM TABLE

I am working on desiging a summary table and need to determine the grouping columns.  I was looking at DBQLObjTbl TypeofUse, but it doesn't show a group by use.  Is there another way to determine the group by columns without having to parse through the sql?

Hi,
I wanted to know how the GROUP BY is processed in TD14. I've read some posts and blogs about GROUP BY vs DISTINCT in pre-TD13 like:
http://forums.teradata.com/forum/database/spool-treatment-for-distinct-versus-group-by

Hi,

 

I am new to Teradata and I am working on query for which I greatly appreciate any help.

 

i have data in a table as shown below:

 

date

id

value

1-Jan-13

1

100

2-Jan-13

1

100

3-Jan-13

Can someone throw some light how can QUALIFY,GROUP BY and HAVING be used together?
Any link to docs or simple example will be usefull.
Also which one takes precedence, when used together and what is the correct syntax when using all three of them?
 
 

I have data  as follows in a Table ( 3 columns ):

Hello,

I have an issue regarding a group by for my query: Error 3540

I understand what it means on a basic level and I believe the issue revolves around this particular column

CAST((COALESCE(price, 0.000000)) AS DECIMAL(18,6)) * quantity amount

We stumbled upon this by accident. We have a query that runs much faster when a group by is added to a derived table when one of the columns in the derived table is the result of a cast/concatenation operation.

The first query/explain posted below has the group by in the derived table. It shows the cast/concatenation being resolved when the derived table is materialized in step 2 in the EXPLAIN. Result is 761 rows and I assume 761 resolutions of the cast/concatenation. The group by does not eliminate any dups.