Date difference in one column
Hi all,
I need the column DATEDIFFERENCE as per below
Kindly help me out .
How to perform on the same column .
Regards, Subathra
create table test (id varchar(10), createddate datetime, assigneddate datetime, resolveddate datetime)
insert into test values ('SD1023','4/2/2014 10:02:00','4/2/2014 10:06:00','6/2/2014 20:06:03')
insert into test values ('SD1023','4/2/2014 10:02:00','4/2/2014 10:20:01','6/2/2014 20:06:03')
insert into test values ('SD1023','4/2/2014 10:02:00','4/2/2014 12:02:00','6/2/2014 20:06:03')
insert into test values ('SD1023','4/2/2014 10:02:00','6/2/2014 20:06:03','6/2/2014 22:10:03')
insert into test values ('SD10123','6/2/2014 20:06:03','6/2/2014 20:06:03','6/2/2014 23:06:06')
insert into test values ('SD10123','6/2/2014 20:06:03','6/2/2014 21:06:04','6/2/2014 23:06:06')
insert into test values ('SD10123','6/2/2014 20:06:03','6/2/2014 22:06:05','6/2/2014 23:06:06')
insert into test values ('SD10123','6/2/2014 20:06:03','6/2/2014 23:06:06','6/2/2014 23:06:06')
;with mycte as (select *,row_number() Over(Partition by id Order by AssignedDate) rn1
,row_number() Over(Partition by id Order by AssignedDate DESC) rn2
from test)
,mycte1 as (
Select m0.id,m0.createddate,m0.assigneddate,m0.resolveddate,
CASE WHEN m0.rn1=1 Then m0.createddate Else m1.assigneddate End as dt1,
CASE WHEN m0.rn2=1 Then m0.resolveddate Else m0.assigneddate end as dt2
from mycte m0 left join mycte m1 on m0.id=m1.id and m0.rn1=m1.rn1+1)
select id,createddate,assigneddate,resolveddate
,datediff(second,dt1,dt2) as [Date Difference in seconds] from mycte1
order by dt1
drop table test
Similar Messages
-
When I import a text file(comma separated) into a numbers spreadsheet all the data goes into one column instead of individual columns based on the comma separators. Excel allows you to do this during the import.. Is there a way to accomplish this in numbers without opening it in Excel and the importing into Numbers.
Your user info says iPad. This is the OS X Numbers forum. Assuming you are using OS X… Be sure the file is named with a .csv suffix.
(I don't have an iPad, so I don't know the iOS answer.) -
How to split the data based on one column
Dear All,
I have the table data like this.
type quantity revenue_mny count country
a 10 10 2 India
a 20 12 3 India
b 30 15 1 India
a 35 20 2 US
b 20 10 1 US
b 60 15 1 US
I woulkd like to split the date based on type column.
For each country, for Type "a" get the sum of revenue count quanity ans same for b
and all shuld come in on row for each country.
output should be like
country revenue_mny(For a) quantity(for a) count(For a) revenue_mny(for b) quantity(for b) count(For b)
India 22 30 5 15 30 1
US 20 35 2 25 80 2
I tried the below query . its not splittng the date for each country in one row.
select country,
sum(case when type='a') then revenue_mny else 0 end ) revenue_mny_a,
sum(case when type='b' then revenue_mny else 0 end ) revenue_mny_b
sum(case when type='a' then quantity else 0 end) quantity_a,
sum(case when type='b' then quantity else 0 end) quantity_b from
test
group by country
Please need your heloLike this?
with t as
select 'a' type, 10 quantity, 10 revenue_mny, 2 cnt, 'India' country from dual union all
select 'a', 20, 12, 3, 'India' from dual union all
select 'b', 30, 15, 1, 'India' from dual union all
select 'a', 35, 20, 2, 'US' from dual union all
select 'b', 20, 10, 1, 'US' from dual union all
select 'b', 60, 15, 1, 'US' from dual
select country,
sum(case when type='a' then revenue_mny else 0 end ) revenue_mny_a,
sum(case when type='a' then quantity else 0 end) quantity_a,
sum(case when type='a' then cnt else 0 end) cnt_a,
sum(case when type='b' then revenue_mny else 0 end ) revenue_mny_b,
sum(case when type='b' then quantity else 0 end) quantity_b ,
sum(case when type='b' then cnt else 0 end) cnt_b
from t
group by country;result:
COUNTRY REVENUE_MNY_A QUANTITY_A CNT_A REVENUE_MNY_B QUANTITY_B CNT_B
India 22 30 5 15 30 1
US 20 35 2 25 80 2Or you can do it with a decode instead of case. The result will be the same:
with t as
select 'a' type, 10 quantity, 10 revenue_mny, 2 cnt, 'India' country from dual union all
select 'a', 20, 12, 3, 'India' from dual union all
select 'b', 30, 15, 1, 'India' from dual union all
select 'a', 35, 20, 2, 'US' from dual union all
select 'b', 20, 10, 1, 'US' from dual union all
select 'b', 60, 15, 1, 'US' from dual
select country,
sum(decode(type,'a',revenue_mny,0)) revenue_mny_a,
sum(decode(type,'a',quantity,0)) quantity_a,
sum(decode(type,'a',cnt,0)) cnt_a,
sum(decode(type,'b',revenue_mny,0)) revenue_mny_b,
sum(decode(type,'b',quantity,0)) quantity_b,
sum(decode(type,'b',cnt,0)) cnt_b
from t
group by country;(I changed tablename from TEST to T and columnname from COUNT to CNT, because you should not use reserved words as tablename or columnname.)
Edited by: hm on 09.10.2012 06:17 -
Date differences if one of the field not presenting
Hi All,
I have two attributes start date and end. I have created formula replacement variable.
some times one of the field coming as blank, in such acase system writing some garbage value but i need blank.
How to resolve this issue.
Reagrds,
J BHi,
You can create a new formula in query designer with a condition such that date difference doesn't fall in the invalid value. If it that invalid value put the result as '0'.
http://help.sap.com/saphelp_nw04/helpdata/en/23/17f13a2f160f28e10000000a114084/frameset.htm
If the output is showing as '0' for the invalid values then in the query properties select the Display zeroes as Do Not Display Zeroes.
http://help.sap.com/saphelp_nw04/helpdata/en/1e/99ea3bd7896f58e10000000a11402f/frameset.htm
Hope this helps.........
Rgs,
Ravikanth. -
Concate 3 column data in to one column.
I would like to concate 3 columns in to one column. all three column has datatype as LONG. Is any one knows how to concate long datatype column into one column?
Thanks in Advance812294 wrote:
Is there any way to not use CLOB datatype? I am fetching data from three different tables.And what fetching from three different tables has to do with CLOB?
SQL> set serveroutput on
SQL> declare
2 concat_result clob;
3 tmp long;
4 begin
5 select text
6 into tmp
7 from dba_views
8 where rownum = 1;
9 concat_result := tmp;
10 select data_default
11 into tmp
12 from dba_tab_columns
13 where data_default is not null
14 and rownum = 1;
15 concat_result := concat_result || tmp;
16 select search_condition
17 into tmp
18 from dba_constraints
19 where search_condition is not null
20 and rownum = 1;
21 concat_result := concat_result || tmp;
22 dbms_output.put_line(concat_result);
23 end;
24 /
select
"LIB_IDX","LIB_NAME","VENDOR_NAME","PROTOCOL_NUM","VERSION_NUM","PATH_NAME","MAP
_FILE","FILE_CFGID","MAP_ELEM","ELEM_CFGID","MAP_SYNC" from v$map_library0 OBJ#
IS NOT NULL
PL/SQL procedure successfully completed.
SQL> SY. -
A data table in one column of a dynamic data table
Hi , I have to design a dynamic data table(with dynamic columns and data) which looks as the following
DETAILS NAME ROLE NUMBER CLASS SECTION
15 MATHS SURESH 15 10 A
20 SCIENCE
25 ENGLISH
15 MATHS SURESH 15 10 A
20 SCIENCE
25 ENGLISH
The data in the column 'DETAILS' should have inner table. The data in this inner table should have hyper links. If there is no inner table infor mation there shold be an image with hyperlink. This data table should also have pagination and sorting features. Please send me some example code for this. Please help me out as i have client demo on mondayYou may find this example useful: [http://balusc.blogspot.com/2006/06/using-datatables.html#NestingDatatables].
To toggle between a nested datatable and a hyperlink with image just use the rendered attribute. E.g.
<h:column>
<h:dataTable rendered="#{!empty dataItem.innerList}">
</h:dataTable>
<h:commandLink rendered="#{empty dataItem.innerList}">
</h:commandLink>
</h:column>
... -
Date Difference in same column
select to_char(CREATEDON,'DD-MM-YYYY HH24:MM:SS'),LABSTATUS,REMARKS from history_paperlesstran
where hnum='797551D' order by to_char(CREATEDON,'DD-MM-YYYY HH24:MM:SS');
Rownum TO_CHAR(CREATEDON,' LABSTATUS REMARKS
1 20-10-2010 08:10:08 1 Barcode number generated and printed
2 20-10-2010 08:10:08 1 Barcode number generated and printed
3 20-10-2010 08:10:08 1 Barcode number generated and printed
4 20-10-2010 08:10:08 1 Barcode number generated and printed
5 20-10-2010 08:10:08 1 Barcode number generated and printed
6 20-10-2010 08:10:08 1 Barcode number generated and printed
7 20-10-2010 09:10:55 3 Recieved in department
8 20-10-2010 09:10:58 3 Recieved in department
9 20-10-2010 09:10:58 3 Recieved in department
10 20-10-2010 09:10:58 3 Recieved in department
11 20-10-2010 09:10:58 3 Recieved in department
12 20-10-2010 10:10:38 3 Recieved in department
13 20-10-2010 11:10:34 1 Barcode number generated and printed
14 20-10-2010 11:10:34 1 Barcode number generated and printed
15 20-10-2010 11:10:35 3 Recieved in department
16 20-10-2010 12:10:08 3 Recieved in department
17 20-10-2010 14:10:03 1 Barcode number generated and printed
18 20-10-2010 14:10:44 3 Recieved in department
18 rows selected.
Dear Friends, Now i want to get the date difference on labstatus based,i.e rownum1 - rownum7, rownum2 - rownum8, and rownum17 - rownum18
Thing is Barcode number generated and printed - Recieved in department for each & every samples.
Advance thanks for your solution...
Edited by: bharathit on Oct 21, 2010 2:18 AMYou mean something like this?
SQL> ed
Wrote file afiedt.buf
1 with t as (select 1 as rn, to_date('20-10-2010 08:10:08', 'DD-MM-YYYY HH24:MI:SS') as dt, 1 as labstatus, 'Barcode number generated and printed' as comments from dual union all
2 select 2, to_date('20-10-2010 08:10:08','DD-MM-YYYY HH24:MI:SS'), 1, 'Barcode number generated and printed' from dual union all
3 select 3, to_date('20-10-2010 08:10:08','DD-MM-YYYY HH24:MI:SS'), 1, 'Barcode number generated and printed' from dual union all
4 select 4, to_date('20-10-2010 08:10:08','DD-MM-YYYY HH24:MI:SS'), 1, 'Barcode number generated and printed' from dual union all
5 select 5, to_date('20-10-2010 08:10:08','DD-MM-YYYY HH24:MI:SS'), 1, 'Barcode number generated and printed' from dual union all
6 select 6, to_date('20-10-2010 08:10:08','DD-MM-YYYY HH24:MI:SS'), 1, 'Barcode number generated and printed' from dual union all
7 select 7, to_date('20-10-2010 09:10:55','DD-MM-YYYY HH24:MI:SS'), 3, 'Recieved in department' from dual union all
8 select 8, to_date('20-10-2010 09:10:58','DD-MM-YYYY HH24:MI:SS'), 3, 'Recieved in department' from dual union all
9 select 9, to_date('20-10-2010 09:10:58','DD-MM-YYYY HH24:MI:SS'), 3, 'Recieved in department' from dual union all
10 select 10, to_date('20-10-2010 09:10:58','DD-MM-YYYY HH24:MI:SS'), 3, 'Recieved in department' from dual union all
11 select 11, to_date('20-10-2010 09:10:58','DD-MM-YYYY HH24:MI:SS'), 3, 'Recieved in department' from dual union all
12 select 12, to_date('20-10-2010 10:10:38','DD-MM-YYYY HH24:MI:SS'), 3, 'Recieved in department' from dual union all
13 select 13, to_date('20-10-2010 11:10:34','DD-MM-YYYY HH24:MI:SS'), 1, 'Barcode number generated and printed' from dual union all
14 select 14, to_date('20-10-2010 11:10:34','DD-MM-YYYY HH24:MI:SS'), 1, 'Barcode number generated and printed' from dual union all
15 select 15, to_date('20-10-2010 11:10:35','DD-MM-YYYY HH24:MI:SS'), 3, 'Recieved in department' from dual union all
16 select 16, to_date('20-10-2010 12:10:08','DD-MM-YYYY HH24:MI:SS'), 3, 'Recieved in department' from dual union all
17 select 17, to_date('20-10-2010 14:10:03','DD-MM-YYYY HH24:MI:SS'), 1, 'Barcode number generated and printed' from dual union all
18 select 18, to_date('20-10-2010 14:10:44','DD-MM-YYYY HH24:MI:SS'), 3, 'Recieved in department' from dual)
19 --
20 -- END OF TEST DATA
21 --
22 ,x as (select rn, dt, labstatus, comments, row_number() over (partition by labstatus order by rn) as labrn from t)
23 --
24 select y.rn as rn1, y.dt as dt1, z.rn as rn2, z.dt as dt2, round((z.dt - y.dt)*24*60) as mins_diff
25 from x y join x z on (y.labrn = z.labrn)
26 where y.labstatus = 1
27* and z.labstatus = 3
SQL> /
RN1 DT1 RN2 DT2 MINS_DIFF
1 20/10/2010 08:10:08 7 20/10/2010 09:10:55 61
2 20/10/2010 08:10:08 8 20/10/2010 09:10:58 61
3 20/10/2010 08:10:08 9 20/10/2010 09:10:58 61
4 20/10/2010 08:10:08 10 20/10/2010 09:10:58 61
5 20/10/2010 08:10:08 11 20/10/2010 09:10:58 61
6 20/10/2010 08:10:08 12 20/10/2010 10:10:38 121
13 20/10/2010 11:10:34 15 20/10/2010 11:10:35 0
14 20/10/2010 11:10:34 16 20/10/2010 12:10:08 60
17 20/10/2010 14:10:03 18 20/10/2010 14:10:44 1
9 rows selected.
SQL> -
I have real complex data (i,q data) for the ISAR imaging. I don't have any knowledge of Labview programming. I bought this signal processing toolset to use only stand-alone time-frequency analyzer.
In the LabVIEW functions palette on the block diagram, if you go to Numeric>>Complex you have to VI's that splits a complex number into rectangular or polar components. Click on the help file for those VI's to see the kind of datatypes you can wire to them.
Cyril Bouton
Active LabVIEW Developper -
How to achieve grouping of data based on one column
Hello PL/SQL Gurus/experts,
I am using Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production version
I have following table -
DROP TABLE T2;
create table T2(Manager,Employee) as select
'Nikki','Ram' from dual union all select
'Nina', 'Rita' from DUAL union all select
'Mike', 'Radha' from dual union all select
'Michael', 'Ratnam' from DUAL union all select
'Hendi', 'Ratna' from dual union all select
'Robert', 'Raman' from dual union all select
'Maria', 'Rolly' from dual union all select
'Kistrien', 'Rachna' from dual union all select
'Andrew', 'Ritvik' from dual union all select
'Emma', 'Ramesh' from dual union all select
'Andy', 'Ranpal' from dual union all select
'Brandy', 'Raunak' from dual union all select
'Nikki','Shyam' from dual union all select
'Nina', 'Sita' from DUAL union all select
'Mike', 'Sadhna' from dual union all select
'Michael', 'Satnam' from DUAL union all select
'Hendi', 'Satna' from dual union all select
'Robert', 'Samar' from dual union all select
'Maria', 'Sameer' from dual union all select
'Kistrien', 'Samrachna' from dual union all select
'Andrew', 'Satvik' from dual union all select
'Emma', 'Somesh' from dual union all select
'Andy', 'Sonpal' from dual union all select
'Brandy', 'Samar' from dual union all select
'Emma', 'Piyush' from dual union all select
'Andy', 'Pavan' from dual union all select
'Brandy', 'Paramjeet' from dual;Expected output -
Manager Employee
Nikki
Ram
Shyam
Nina Rita
Sita
Mike Radha
Sadhna
Michael Ratnam
Satnam
Hendi Ratna
Satna
Robert Raman
Samar
Maria Rolly
Sameer
Kistrien Rachna
Samrachna
Andrew Ritvik
Satvik
Emma Ramesh
Somesh
Piyush
Andy Ranpal
Sonpal
Pavan
Brandy Raunak
Samar
ParamjeetI thank to all of you in advance for your valuable time and inputsIn SQL, something like this...
SQL> ed
Wrote file afiedt.buf
1 select case when row_number() over (partition by emp.manager order by employee) = 1 then
2 mgr.manager
3 else
4 null
5 end as manager
6 ,emp.employee
7 from (select distinct manager from t2) mgr
8 join t2 emp on (mgr.manager = emp.manager)
9* order by mgr.manager, emp.employee
SQL> /
MANAGER EMPLOYEE
Andrew Ritvik
Satvik
Andy Pavan
Ranpal
Sonpal
Brandy Paramjeet
Raunak
Samar
Emma Piyush
Ramesh
Somesh
Hendi Ratna
Satna
Kistrien Rachna
Samrachna
Maria Rolly
Sameer
Michael Ratnam
Satnam
Mike Radha
Sadhna
Nikki Ram
Shyam
Nina Rita
Sita
Robert Raman
Samar
27 rows selected.If you want the managers on their own row with the employees underneath then you'll have to fudge it.
SQL> ed
Wrote file afiedt.buf
1 select case when row_number() over (partition by emp.manager order by employee nulls first) = 1 then
2 mgr.manager
3 else
4 null
5 end as manager
6 ,emp.employee
7 from (select distinct manager from t2) mgr
8 join
9 (select distinct manager, null as employee from t2
10 union all
11 select manager, employee from t2
12 ) emp on (mgr.manager = emp.manager)
13* order by mgr.manager, emp.employee nulls first
SQL> /
MANAGER EMPLOYEE
Andrew
Ritvik
Satvik
Andy
Pavan
Ranpal
Sonpal
Brandy
Paramjeet
Raunak
Samar
Emma
Piyush
Ramesh
Somesh
Hendi
Ratna
Satna
Kistrien
Rachna
Samrachna
Maria
Rolly
Sameer
Michael
Ratnam
Satnam
Mike
Radha
Sadhna
Nikki
Ram
Shyam
Nina
Rita
Sita
Robert
Raman
Samar
39 rows selected. -
How do I add more than one column to a table using SQL?
Hi
I need to add 3 columns to a table using SQL
the syntax
"ALTER TABLE TEST ADD COLUMN newcol1 float";
works fine - for adding one coumn only.
For multiple columns I tried various permutations along the lines of
"ALTER TABLE TEST ADD (COLUMN newcol01 float, COLUMN new2 float,COLUMN new3 float)";
"ALTER TABLE TIPSTEST ADD COLUMN new1 float"
"ALTER TABLE TIPSTEST ADD COLUMN new2 float"
"ALTER TABLE TIPSTEST ADD COLUMN new3 float"
etc., but this doesn't work.
From a web search it sounds like SQL can only add one column at a time.
I have a workaround : create intermediate temporary tables , copying data and adding
one column at each stage. It seems a fairly awkward way of programming though.
Am I missing something simple : is there a way to add multiple columns in one go?
ThanksOK : solved an underlying problem with this one myself
for the code
String createString;
createString = "select COFFEES.* INTO NEWCOFFEES FROM COFFEES"; // example
Statement stmt;
try {
stmt = a_Globals.database1Connection.createStatement();
stmt.executeUpdate(createString);
stmt.close();
a_Globals.database1Connection.close();
} catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
} commenting out the line:
a_Globals.database1Connection.close();
Allowed the subsequent SQL statement(s) to work OK. Looks like this was the cause of several
difficulties, preventing me doing several SQL instructions in turn.
Thanks for the responses.
Mike2z -
How can I Move data from one column to another in my access table?
I have two columns, one that stores current month’s data and one that stores last month’s data. Every month data from column 2 (this month’s data) needs to be moved to column 1 that holds last month’s data. I then null out column 2 so I can accumulates this month’s data.
I understand how to drop a column or add a column, how do I transfer data from one column to another.
Here is my trial code:
<cfquery name="qQueryChangeColumnName" datasource="#dsn#">
ALTER TABLE leaderboard
UPDATE leaderboard SET points2 = points3
</cfquery>
Unfortunately, I get the following error:
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE statement.
How can I transfer my data with the alter table method?I looked up the Access SQL reference (which is probably a
good place to start when having issues with Access SQL), and
it suggests you probably need a WHERE clause in there.
I agree the documentation is a good place to start. But you should not need a WHERE clause here.
Too few parameters. Expected 1.
If you run the SQL directly in Access, what are the results? At the very least, it should provide a more informative error message.. -
OAF Export button fetching data in one column - view object using union all
Dear All,
Export button showing data in one column from view object,
View object is based on mulitple queries with union all ,
Please let me know the solution for this issue.
Thanks
Maheswara RajuMaheswara Raju,
As per my understanding you are not able to export all the View Attribute using export Button. Only the attribute which is used with the item/region will get exported.
There are few work around in case if you want to export the column without showing on OAF Page. Let me know.
Cheers
Gyan -
Introduction
In SQL Server Reporting Services, we can define a mapping between the fields that are returned in the query to specific delivery options and to report parameters in a data-driven subscription.
For a report with a parameter (such as YEAR) that allow multiple values, when creating a data-driven subscription, how can we pass a record like below to show correct data (data for year 2012, 2013 and 2014).
EmailAddress Parameter
Comment
[email protected] 2012,2013,2014 NULL
In this article, I will demonstrate how to configure a Data Driven Subscription which get multi-value parameters from one column of a database table
Workaround
Generally, if we pass the “Parameter” column to report directly in the step 5 when creating data-driven subscription.
The value “2012,2013,2014” will be regarded as a single value, Reporting Services will use “2012,2013,2014” to filter data. However, there are no any records that YEAR filed equal to “2012,2013,2014”, and we will get an error when the subscription executed
on the log. (C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\LogFiles)
Microsoft.ReportingServices.Diagnostics.Utilities.InvalidReportParameterException: Default value or value provided for the report parameter 'Name' is not a valid value.
This means that there is no such a value on parameter’s available value list, this is an invalid parameter value. If we change the parameter records like below.
EmailAddress Parameter Comment
[email protected] 2012 NULL
[email protected] 2013 NULL
[email protected] 2014 NULL
In this case, Reporting Services will generate 3 reports for one data-driven subscription. Each report for only one year which cannot fit the requirement obviously.
Currently, there is no a solution to solve this issue. The workaround for it is that create two report, one is used for view report for end users, another one is used for create data-driven subscription.
On the report that used create data-driven subscription, uncheck “Allow multiple values” option for the parameter, do not specify and available values and default values for this parameter. Then change the Filter
From
Expression:[ParameterName]
Operator :In
Value :[@ParameterName]
To
Expression:[ParameterName]
Operator :In
Value :Split(Parameters!ParameterName.Value,",")
In this case, we can specify a value like "2012,2013,2014" from database to the data-driven subscription.
Applies to
Microsoft SQL Server 2005
Microsoft SQL Server 2008
Microsoft SQL Server 2008 R2
Microsoft SQL Server 2012
Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.For every Auftrag, there are multiple Position entries.
Rest of the blocks don't seems to have any relation.
So you can check this code to see how internal table lt_str is built whose first 3 fields have data contained in Auftrag, and next 3 fields have Position data. The structure is flat, assuming that every Position record is related to preceding Auftrag.
Try out this snippet.
DATA lt_data TYPE TABLE OF string.
DATA lv_data TYPE string.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = 'C:\temp\test.txt'
CHANGING
data_tab = lt_data
EXCEPTIONS
OTHERS = 19.
CHECK sy-subrc EQ 0.
TYPES:
BEGIN OF ty_str,
a1 TYPE string,
a2 TYPE string,
a3 TYPE string,
p1 TYPE string,
p2 TYPE string,
p3 TYPE string,
END OF ty_str.
DATA: lt_str TYPE TABLE OF ty_str,
ls_str TYPE ty_str,
lv_block TYPE string,
lv_flag TYPE boolean.
LOOP AT lt_data INTO lv_data.
CASE lv_data.
WHEN '[Version]' OR '[StdSatz]' OR '[Arbeitstag]' OR '[Pecunia]'
OR '[Mita]' OR '[Kunde]' OR '[Auftrag]' OR '[Position]'.
lv_block = lv_data.
lv_flag = abap_false.
WHEN OTHERS.
lv_flag = abap_true.
ENDCASE.
CHECK lv_flag EQ abap_true.
CASE lv_block.
WHEN '[Auftrag]'.
SPLIT lv_data AT ';' INTO ls_str-a1 ls_str-a2 ls_str-a3.
WHEN '[Position]'.
SPLIT lv_data AT ';' INTO ls_str-p1 ls_str-p2 ls_str-p3.
APPEND ls_str TO lt_str.
ENDCASE.
ENDLOOP. -
Query to get the data of all the columns in a table except any one column
Can anyone please tell how to write a query to get the data of all the columns in a table except one particular column..
For Example:
Let us consider the EMP table.,
From this table except the column comm all the remaining columns of the table should be listed
For this we can write a query like this..
Select empno, ename, job, mgr, sal, hiredate, deptno from emp;
Just to avoid only one column, I mentioned all the remaining ( 7 ) columns of the table in the query..
As the EMP table consists only 8 columns, it doesn't seem much difficult to mention all the columns in the query,
but if a table have 100 columns in the table, then do we have to mention all the columns in the query..?
Is there any other way of writing the query to get the required result..?
Thanks..Your best best it to just list all the columns. Any other method will just cause more headaches and complicated code.
If you really need to list all the columns for a table because you don't want to type them, just use something like...
SQL> ed
Wrote file afiedt.buf
1 select trim(',' from sys_connect_by_path(column_name,',')) as columns
2 from (select column_name, row_number() over (order by column_id) as column_id
3 from user_tab_cols
4 where column_name not in ('COMM')
5 and table_name = 'EMP'
6 )
7 where connect_by_isleaf = 1
8 connect by column_id = prior column_id + 1
9* start with column_id = 1
SQL> /
COLUMNS
EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,DEPTNO
SQL> -
Hi, thanks for taking the time...
I'm running a machine with Windows 7, Office 2010, and Acrobat XI. When I save a specific PDF as an Excel workbook, all of the data in the original PDF is sorted correctly in four columns. When the same task is performed on this file on another user's machine, all of the data is sorted into one column. The user has the same versions of Windows, Office, and Acrobat. I've attempted the "Repair installation" option but the problem persists. Any suggestions? Thanks again for helping,
-EThanks for the quick reply. I figured out how to get the desired results by using tagging. For anyone who may reference this post in the future, I went to "Customize" in the top right corner of Adobe, then selected "Create new tool set...", looked under "accessiblity and found the "tag" option. Hit ok, tag is added to the toolbar. Then I highlighted the dataset in the PDF that was relevant to the output format, then clicked "tag", saved as spreadsheet. Sorry I can't provide more details on how tagging works or if there's a more elegant solution available, but I'm sure one's out there.
Maybe you are looking for
-
Premiere freezes when sending to Media Encoder Queue
Hey guys, This issue is on all of our computers (Mac Pros and 27" iMacs) and happens on 40% of attempted exports through Media Encoder. Here's our new workflow: - Export TImeline (Command + M) - Send to Media Encoder (Queue button) - Media Encoder Op
-
Bridge - Exposure Camera Data (Exif) metadata display problem
I'm working with raw files with thumbnails displayed in Bridge Content. In Bridge preferences > Metadata I have Exposure and Exposure Bias Value checked on. (These are the first two lines in the metadata panel.) When I select a raw file in Bridge t
-
i have an assignment from the book java programming d.s malik. problem: for research purposes and to assist students, the admissions office of your local university wants to determine the performance of the female and male students in certain courses
-
T61 with XP not coming up after installation of IE7 & WMP11
Hi, My machine is T61 7665-13A. This came pre-installed with Vista, which I downgraded to XP Professional with SP2. I'm facing a strange issue. After I installed IE 7 and Windows Media Player 11, my notebook is not coming up. It reaches a stage whic
-
SAP CPS Redwood Global Variables
Hello Everyone We have job chain consisting of the below manner 1)Job1 2)Job2 3)Check whether the prior run of Job3 is success 4)Job4 In order to achieve the above requirement we are thinking to use global variables which will be updated at the end o