﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Teradata Forums / Teradata  / Teradata Database  / Query Help / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>Teradata Forums</description><link>http://www.teradata.com/teradataforum/</link><webMaster>info@teradata.com</webMaster><lastBuildDate>Sat, 21 Nov 2009 10:39:15 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Query Help</title><link>http://www.teradata.com/teradataforum/Topic7526-9-1.aspx</link><description>As a matter of fact, the user doesn't require create table privileges to create volatile table.</description><pubDate>Mon, 04 Jun 2007 04:40:18 GMT</pubDate><dc:creator>joedsilva</dc:creator></item><item><title>RE: Query Help</title><link>http://www.teradata.com/teradataforum/Topic7526-9-1.aspx</link><description>I used it only to show how it can be implemented.&lt;br&gt;In any case could you tell what kind of priviledges it require except create table?</description><pubDate>Mon, 04 Jun 2007 03:31:57 GMT</pubDate><dc:creator>Mitrich</dc:creator></item><item><title>RE: Query Help</title><link>http://www.teradata.com/teradataforum/Topic7526-9-1.aspx</link><description>volatile table need more priviledge than just create tables :-)&lt;br&gt;&lt;br&gt;</description><pubDate>Thu, 31 May 2007 04:24:06 GMT</pubDate><dc:creator>Luckyhansh</dc:creator></item><item><title>RE: Query Help</title><link>http://www.teradata.com/teradataforum/Topic7526-9-1.aspx</link><description>Perhaps I'm missing the point , but could you not just use select distinct?</description><pubDate>Fri, 25 May 2007 10:49:21 GMT</pubDate><dc:creator>PhilP</dc:creator></item><item><title>RE: Query Help</title><link>http://www.teradata.com/teradataforum/Topic7526-9-1.aspx</link><description>I don't see any other ways how to solve your problem.&lt;br&gt;Ask permission either to create table or insert rows.&lt;br&gt;&lt;br&gt;This problem was disscused here:&lt;br&gt;www.teradataforum.com/teradata/20040505_182346.htm&lt;br&gt;&lt;br&gt;Best regards,&lt;br&gt;Mitrich</description><pubDate>Mon, 21 May 2007 00:44:22 GMT</pubDate><dc:creator>Mitrich</dc:creator></item><item><title>RE: Query Help</title><link>http://www.teradata.com/teradataforum/Topic7526-9-1.aspx</link><description>Hi Mitrich,&lt;br&gt;&lt;br&gt;Your script works!! I cant implement it bcoz i dont hav the rights to INSERT any new rows, can you advise please? &lt;br&gt;&lt;br&gt;Regards.</description><pubDate>Sun, 20 May 2007 23:36:01 GMT</pubDate><dc:creator>Meem</dc:creator></item><item><title>RE: Query Help</title><link>http://www.teradata.com/teradataforum/Topic7526-9-1.aspx</link><description>Try this&lt;br&gt;----------------------------------&lt;br&gt;create volatile multiset table test123 (&lt;br&gt;	id integer&lt;br&gt;	,name varchar(20)&lt;br&gt;) on commit preserve rows&lt;br&gt;;&lt;br&gt;insert into test123 (1, 'aaaa');&lt;br&gt;insert into test123 (1, 'aaaa');&lt;br&gt;insert into test123 (2, 'bbbb');&lt;br&gt;insert into test123 (2, 'bbbb');&lt;br&gt;insert into test123 (3, 'cccc');&lt;br&gt;&lt;br&gt;&lt;br&gt;insert into test123&lt;br&gt;	select id, '##'||name as name&lt;br&gt;	from test123&lt;br&gt;	qualify row_number() over(partition by id order by id) = 1&lt;br&gt;;&lt;br&gt;delete from test123 where not name like '##%'&lt;br&gt;;&lt;br&gt;update test123 set name = substring(name from 3)&lt;br&gt;;&lt;br&gt;select * from test123&lt;br&gt;-----------------------------------------------------------&lt;br&gt;&lt;br&gt;</description><pubDate>Sun, 20 May 2007 22:54:08 GMT</pubDate><dc:creator>Mitrich</dc:creator></item><item><title>RE: Query Help</title><link>http://www.teradata.com/teradataforum/Topic7526-9-1.aspx</link><description>Hi Mitrich,&lt;br&gt;Thanks for your reply!&lt;br&gt;It did worked but im in need of a Delete query which would produce the result similar to the one you mentioned.&lt;br&gt;&lt;br&gt;Regards&lt;br&gt;</description><pubDate>Sun, 20 May 2007 20:47:22 GMT</pubDate><dc:creator>Meem</dc:creator></item><item><title>RE: Query Help</title><link>http://www.teradata.com/teradataforum/Topic7526-9-1.aspx</link><description>Hi Meem,&lt;br&gt;&lt;br&gt;Try this:&lt;br&gt;&lt;br&gt;SELECT EMPID, EMPNAME, EMPSSN FROM EMPLOYEE GROUP BY 1,2,3&lt;br&gt;&lt;br&gt;It should remove all duplicates.&lt;br&gt;&lt;br&gt;</description><pubDate>Sun, 20 May 2007 20:28:19 GMT</pubDate><dc:creator>Mitrich</dc:creator></item><item><title>Query Help</title><link>http://www.teradata.com/teradataforum/Topic7526-9-1.aspx</link><description>Hi All,&lt;br&gt;I would like to eliminate duplicates and make the following table with unique records. I wish to have a query to solve such issues.&lt;br&gt;&lt;br&gt;TableName : EMPLOYEE&lt;br&gt;&lt;br&gt;EMPID EMPNAME EMPSSN&lt;br&gt;************************&lt;br&gt;1    Jack   555-55-5555&lt;br&gt;2    Joe    555-56-5555&lt;br&gt;3    Fred   555-57-5555&lt;br&gt;4    Mike   555-58-5555&lt;br&gt;5    Cathy  555-59-5555&lt;br&gt;6    Lisa   555-70-5555&lt;br&gt;1    Jack   555-55-5555&lt;br&gt;4    Mike   555-58-5555&lt;br&gt;5    Cathy  555-59-5555&lt;br&gt;6    Lisa   555-70-5555&lt;br&gt;6    Lisa   555-70-5555&lt;br&gt;.    ....   ...........&lt;br&gt;.    ....   ...........&lt;br&gt;.    ....   ...........&lt;br&gt;&lt;br&gt;Note :&lt;br&gt;I dont have the rights to Create any Table&lt;br&gt;I dont have the rights to Add a new Column to the table&lt;br&gt;Im not suppose to use any other utils&lt;br&gt;&lt;br&gt;I tried a Query using Row_Number() which makes the records unique but again i donno how to remove duplicates, Kindly help!&lt;br&gt;&lt;br&gt;SELECT B.EMPID,&lt;br&gt;       B.EMPNAME,&lt;br&gt;       B.EMPSSN, &lt;br&gt;       MIN(A.RID)&lt;br&gt;FROM &lt;br&gt;       EMPLOYEE B, &lt;br&gt;       (SELECT EMPID,&lt;br&gt;	       ROW_NUMBER() OVER (ORDER BY EMPID ASC)   RID&lt;br&gt;       FROM EMPLOYEE) A&lt;br&gt;WHERE &lt;br&gt;       B.EMPID = A.EMPID&lt;br&gt;GROUP BY 1,2,3;&lt;br&gt;&lt;br&gt;&lt;br&gt;Cheers&lt;br&gt;Meem</description><pubDate>Sun, 20 May 2007 02:52:59 GMT</pubDate><dc:creator>Meem</dc:creator></item></channel></rss>