Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Convert common ids having different value into separate column

Highlighted

Convert common ids having different value into separate column

New Contributor

Hi All,

     Current output is as below trying to get below expected output.

 

Work-audit_Task IDWork-audit_DateWorkAudit_IterNum
32019-12-25 09:41:34.0001
32019-12-25 09:42:55.0001
102019-12-25 09:44:12.0001
102019-12-25 09:44:36.0001
32019-12-25 09:45:08.0002
32019-12-25 09:45:28.0002
102019-12-25 09:50:48.0002

 

Expected Output:

Work-audit_Task IDWork-audit_Start_DateWork-audit_End_DateWorkAudit_IterNum
32019-12-25 09:41:34.0002019-12-25 09:42:55.0001
102019-12-25 09:44:12.0002019-12-25 09:44:36.0001
32019-12-25 09:45:08.0002019-12-25 09:45:28.0002
102019-12-25 09:50:48.000 2

 

 

Need a SQL query for above expected output.

2 REPLIES 2

Re: Convert common ids having different value into separate column

Community Manager

@Prik What or which SQL engine are you going to try and use the SQL query contributed by community members against? The supported syntax for the variants of SQL available in Hive or Impala, for example, aren't necessarily interchangeable and you didn't specify what you are working with. 

 

 

 

 

Bill Brooks, Community Manager
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Highlighted

Re: Convert common ids having different value into separate column

New Contributor

I am working on SQL Server 2014 Management Studio, I want to bring the Audit WorkAuditdetails from Opentext content server environment. based on the WorkAudit_TaskID(3,10) for specific users.

Don't have an account?
Coming from Hortonworks? Activate your account here