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!

Converting SQL Server to Teradata

Status
Not open for further replies.

ek400

Technical User
Aug 20, 2002
2
US
I am working on a project to convert SQL Server syntax to Teradata and am using Queryman.
Here is some basic code I am trying to convert:

select cast(((select cast(count(*) as numeric) from Dimtable where StdCode is not null) /(select cast(count(*) as numeric) from Dimtable)) * 100 as numeric(5,2))
as '% Std Values'

Also information/links on converting joins would be helpful.
Thanks!
 
ek400,

try this...

select
cast((sub1.n1) as decimal(9,2))/sub2.n2 * 100 as "% Std Values"
from
(
select
count(*) as n1
from
dimtable
where
stdcode is not null
)sub1,
(
select
count(*) as n2
from
dimtable
)sub2
 
Sridharan,
Thanks for the code! I ran it successfully.

ek400
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top