Result from select to variable - forum topic by ctpm
Hi all, i am there new, i try write function or procedure which out will be variable.I don't know how assign result from select() to the variable.Primary goal is compare structure of 2 tables. I...
View ArticleRecursive Query - response (10) by Sarah_07
Hi Dieter, Actually this is a hierarchy method. Below are a sample data. DND_NO REC1 LATEST_DND 100 200 300 200 300 300 300 0 300 400 500 800 500 600 800 600 700 800 700 800 800 800 0 800 I need to...
View ArticleMove column data as rows - response (3) by Raja_KT
Hi, create table then select The query: SELECT NAME as ID FROM tabl1---note here I want to get the col as you want UNION ALL SELECT DISTINCT TO_CHAR(ID) FROM tabl1 UNION ALL SELECT VALUE FROM...
View ArticleCreate Table error when executing a stored procedure - forum topic by hassanq23
Hi guys, I have a stored procedure which does a lot of things, one of which is executing multiple create table AS statements. Now the error that is coming is that the ETL user that I have created to...
View ArticleHow to improve query performance on left our joins. - forum topic by vuyyuru05
Hi Dieter, Can u please help me in optimization of below query. INSERT INTO HBARCH.Table1 SELECT RIA.COMPANY_ID ,RIA.DOC_NO ,RIA.QCI ,RIA.RIA_TOUR_CDE ,RIA.PNR_LOC ,T423.TRAVPLNI...
View ArticleRecursive query - forum topic by arbiswas
Hi Experts, My table is like EMPLOYEE_ID HR_ID 100 200 101 200 200 999 201...
View ArticleCase statement not pulling time between 18:31:01 and 19:00:00 - forum topic...
My data has four columns date, departure, destination and depart time. I have a case statement that groups depart times. It works fine but it does not group departures between 18:31 and 19:00. Time is...
View ArticleRecursive query - response (1) by Raja_KT
Hi Arindam, Yes a recursive query will do the work. Have you tried with a self join of the table and then concatenate to get the desired result. It is a hierarchical form of query. I am going to...
View ArticleCase statement not pulling time between 18:31:01 and 19:00:00 - response (1)...
Hi, How about beyond 18:31 and 19:00? Next time, if you dont mind, when you paste your result set, please put in a proper format so that it will be easy to see. Cheers, Raja
View ArticleRecursive Query - response (11) by Sarah_07
I have tried this using many left outer joins. But the hierarchy level wouldn't change for some records. Dont know how to overcome that issue. Any help would be much appreciated. SELECT...
View ArticleRecursive Query - response (12) by M.Saeed Khurram
Sarah, So you main target is to get the latest_DND, Does this means that a DND goes through diffrent values? like at start it is 105 and at the current value is 4008. from this data, I assume that...
View ArticleRecursive query - response (2) by arbiswas
Hi Raja, Anyone can anyone help on this? Thanks, Arindam
View ArticleRecursive Query - response (13) by Sarah_07
Hi Khurram, The actual condition is, for a particular DND value if the correspoding rec1 value is 0 then latest_dnd should be dnd only. Consider the set of values i have provided as sample. For the...
View ArticleRecursive query - response (3) by gerardo
Try,WITH RECURSIVE REC_TBL ( emp_id, boss_id ) AS (SELECT emp_id, (boss_id) AS boss_id FROM employee_tbl UNION ALL SELECT a.emp_id, b.boss_id FROM REC_TBL A , employee_tbl b WHERE a.boss_id = b.emp_id)...
View ArticleHow to improve query performance. - forum topic by rtakle_d
Hi , Below Mention Query is running in Orlace however i now this not correct place to ask oracle question here . anyone can suggest how i can tune below mention query because it's taking 5 hrs in...
View ArticleSQL MERGE Detecting Duplicate Rows - response (1) by sumanb19
We can't use Extract(HOUR from CURRENT_TIMESTAMP) in INSERT STATEMENT in MERGE. It throws an error that expression must match INSERT specification primary index and partition columns. Is there anyway...
View ArticleMove column data as rows - response (4) by gerardo
try, select id, max(case when name ='a' then value else null end) as A, max(case when name ='b' then value else null end) as B, .. from table group by 1 Regards Gerardo
View ArticleRecursive query - response (4) by Raja_KT
Hi Arindam, I dont have access to Teradata. I have one free oracle online server. So I tried with that for solutions, since I work on other Databases too. I dont know if I can have a Teradata online...
View ArticleRecursive query - response (5) by arbiswas
Hi Raja, If a query runs fine in Oracle then there is 99% chance that it will run on TD also. I will let u know with the results.Thanks, Arindam
View ArticleRecursive query - response (6) by arbiswas
Hi Gerardo, Thanks, I will check and will let u know the result.
View Article