Teradata SQL Assistant Shortcuts ctrl + T This will clear all the queries in the Teradata Query Editor ctrl + Q This will format the query in the Teradata Query Editor ctrl + D This is used to comment and uncomment the selected query text in the Teradata Query Editor F11 This will get you the last error message ctrl + C This is used to copy the selected Text in the Teradata Query Editor Ctrl + P This is used to paste the copied content into the Teradata Query Editor Ctrl + F This is used to find a Text in Teradata Query Editor Ctrl + H This is used to Find and Replace the Text in Teradata Query Editor Shift + F10 + I This will get you the current date in the Teradata Query Editor F5 This will execute the Query in the Current Query Tab in the Teradata Query Editor F6 This will get you the execution plan for the query in the Query Editor F9 This is used to execute the Query in Parallel.
The below query is used to identify the data distribution across AMP's in Teradata SELECT HASHAMP(HASHBUCKET(HASHROW( index_columns ))) AS AMP_NO , COUNT(*) FROM databasename.tablename GROUP BY 1 ORDER BY 1;
Remove dot in the result from decimal values in Teradata In Teradata if I export decimal(18,0) values to a file the dot(.) is appended with the values.Example : If the value is 123 in a table then the 123. is stored in a file. to avoid this issue we can useCAST(CAST(SUM(a.amt) AS CHAR(20)) AS DECIMAL(18,0) FORMAT’Z(20)9′ ) as Amthere amt is a decimal(18,0) value.Z, when used with integer types implies a place holder for a digit, which if there are no digits, could be supplemented with a space. 9, on the other hand will supplement a missing digit with 0so if you do ZZ formating for 7, you get 7 99 formating will give 07 and Z9 formating will also give 7 but ZZ formating of 0 gives two space characters where as Z9 formating of 0 will give 0
Comments
Post a Comment