Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Teradata duplicate row count

Status
Not open for further replies.

nismit

Technical User
Dec 1, 2011
1
AU
Hi
I want to insert duplicate row count in counter coulmn of same table. I had coded this but i get alias issue (illegal usage of Alias)here.
here is my query
UPDATE tablea C
FROM
(
SELECT col1,
Col2,
COUNT(col1 || Col2)
AS CNT
FROM tablea
WHERE col1 > '
AND col2 > '
HAVING COUNT(*) > 1
GROUP BY 1,2
) AS CCNT
SET c.counter col = CCNT.CNT
WHERE
(c.Col1,c.Col2)
IN (SELECT col1,
col2
FROM tablea
WHERE col1 > '
AND col2 > '
HAVING COUNT(*) > 1
GROUP BY 1,2
)

kindly help...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top