QUERY REWRITE - forum topic by ashikmh
HI ALL, I AM FACING THE BELOW PROBLEM AT MY SITE. select TABLE1.* from work_db.TABLE11 XLA inner join work_db.TABLE2 on ( ( TABLE1.COLUMN1 = TABLE2.COLUMN1 and...
View ArticleRefreshing View? - forum topic by barani_sachin
Hi All, On top of a table i am creating a view as replace view v1 as sel * from tabl1; After creating this view i have added some columns in the base table. I am able to use those columns after...
View ArticleIF/THEN Statement not working (Stored Procedure) - forum topic by staples728
Hello, I have a dynamic stored procedure with an if statement setting a stmt to include in my insert statement. I will only share a portion of the code, enough to get the idea across. The procedure...
View ArticleDistinct in Case clause - response (2) by dmenzaghi
Yes for sure. I use a more realistic sample to explain. My starting table:Sales_Trx_IdGross_Sales_AmtItem_QtyItem_Division_CdSales_Trx_Tm 710566684 002 001 24 17:56:19 711879367 001 001 24 16:42:03...
View ArticleDistinct in Case clause - response (3) by dnoeth
count(distinct case when Sales_Trx_Tm time < '12:00:00' then Sales_Trx_Tm end) Dieter
View ArticleDistinct in Case clause - response (4) by dmenzaghi
Sorry, errata corridge: Group by clause is over ITem_Division_Cd and not by sales_trx_id. Thanks
View ArticleIF/THEN Statement not working (Stored Procedure) - response (1) by dnoeth
Posting a MySQL error message in a Teradata forum is probably not the right place :-) Dieter
View ArticleRefreshing View? - response (1) by dnoeth
This is Standard SQL behaviour. The columns returned by a view are resolved when the view is created. A SELECT * represents the existing columns at that point in time. Dieter
View ArticleQUERY REWRITE - response (1) by dnoeth
DON'T SHOUT!!! No, there's no other way to avoid the product join besides rewriting as a UNION or improving your data model :-) Dieter
View ArticleDistinct in Case clause - response (5) by dnoeth
Could you format your data, it's not readable. Dieter
View ArticleCASE Statement -- CASE - forum topic by jacksonprice
Hello -- I have a CHAR column which is returning '0' vs. NULL or blank. I have tried several flavors of CASE, but cannot override the '0' with ' ', etc. The closest I have come is to do a LIKE...
View ArticleCASE Statement -- CASE - response (1) by dnoeth
Hi Jackson, i really don't understand what you actually want. What data is in your column and what data should be reruned by the CASE?'0' replaced by blanks? CASE WHEN columA = '0' THEN '' ELSE columnA...
View ArticleRefreshing View? - response (3) by ToddAWalter
It's a feature! If you do not replace the view, the applications using it are unaffected by the changes to the underlying table definitions.
View ArticleCombining multiple rows into a single row - response (1) by ToddAWalter
SELECT cust_id, name, max(age),max(telno),... GROUP BY cust_id, name; Hopefully there is some way to identify which rows are new so that these don't get coalesced with prior rows for a customer (eg an...
View ArticleQUERY REWRITE - response (2) by karthik_2244
Hi, Can you try this and check if this helps. select TABLE1.* from work_db.TABLE11 XLA left join work_db.TABLE2 A on TABLE1.COLUMN1 = A.COLUMN1 and TABLE1.COLUMN2 = A.COLUMN2 left join...
View ArticleCombine Multiple Select Statements - response (10) by MBSconnection
Thanks Dieter, The code is not working, I made a little change. SELECT t1.datetm, t1,cnt, t2.cnt FROM ( SELECT COUNT(DISTINCT RP.REGIS_PRSNA_ID) AS cnt, CAST (RP.REGIS_DATETM AS DATE) AS datetm FROM...
View Articlevolatile table as select..with data - not loading data - response (11) by...
How do I create a Table from Select Query with Data? Below is my Query and Table I want to create? create table TWM_SANDBOX.tbl1_frm_qry1 as ( SELECT CAST (RP.REGIS_DATETM AS DATE), COUNT(DISTINCT...
View Articlevolatile table as select..with data - not loading data - response (12) by...
You will have to use Primary index something like below create table TWM_SANDBOX.Tbl_frm_Query1 as ( SELECT CAST (RP.REGIS_DATETM AS DATE), COUNT(DISTINCT RP.REGIS_PRSNA_ID) FROM...
View ArticleMax No Of teradata Connections - forum topic by TDUser2011
A PE supports max no of120 sessions. So if there is one PE in a node. Does that mean there cannot be more then 120 connections opened to insert/select data from Teradata ? Asking this connection...
View Article