SQL

UDA

SQL

Hello everyobody,

I am totally new to teradata and my SQL background is also not so long. I will be working with TERADATA ODBC driver 3.03. I need to make a select based on a string field. All entries are strings ending with a special character which I was told is a new character....
How can I write a select where I will filter out my entries?
Something like:

SEL descr FROM Table WHERE descr = 'my description\13'

By the way. Is there a complete reference of all Teradata SQL statements with descriptions and examples?

Any help is greatly apreciated

Vasilis
5 REPLIES
Enthusiast

Re: SQL

Vasilis,
sounds like you might use
'like'

select * from table where column like '%a%';

or

sel * from table
where colname like any ('%a%', '%b%');

SQL reference found www.info.ncr.com

Tbob

Re: SQL

Thanks Tbob,

but the problem is that I have entries in this field like:

colname
------------------
'my description.\n'
'my description and some more.\n'
.....

so I can't use this statement:

sel * from table where colname like 'my description.%'

because it will return both rows in the example above....
unless I do something like

sel * from table where colname like 'my description.%' and
colname NOT like 'my description %'

but it does not look so elegant...
Junior Contributor

Re: SQL

Hi Vasilis,
try
SEL descr FROM Table WHERE descr = 'my description' || '0D'xc

'0D'xc: "x" means a hex-string to be converted to a "c" character-string

Dieter

Re: SQL

thx Dieter,
I will try this
Enthusiast

Re: SQL

hai

The fact is that, we go for dimensional modeling insted on TNF is due to the limitations of the OLAP tools. teradata can perform effectively with the TNF table structure.