| Help any one with a code please [message #645753] |
Mon, 14 December 2015 09:24  |
 |
vs140580
Messages: 70 Registered: December 2015
|
Member |
|
|
A row of columns containing a,b,c,d,e intersects with a row of cells b,x,a,y,z twice, on the elements a,b.
N+1 rows of N elements, such than there are N*(N+1) / 2 total elements, each duplicated twice.
Further more, the intersection of any two rows is exactly 1 element.
Example
(0,1), (0,2), (0,3), (3,4)
(0,1), (1,3), (1,2), (2,4)
(0,2), (2,3), (1,2), (1,4)
(1,4), (2,4), (0,4),(0,3)
Each row contains each line of above and each column contains (0,1) next (0,2) etc so there are 4 columns and we have to choose 5 rows with five columns like this u can see the intersection there I feel
I here by upload a csv sample file from which we have to pick all possible types of 5 rows with the above conditions as there are 4 columns in this sample set. In the csv TAB is my delimiter as , is used within brackets.
[MERGED by LF]
-
Attachment: sample.csv
(Size: 2.94KB, Downloaded 1363 times)
[Updated on: Tue, 15 December 2015 00:10] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: Help with a command [message #645844 is a reply to message #645840] |
Tue, 15 December 2015 09:05   |
 |
vs140580
Messages: 70 Registered: December 2015
|
Member |
|
|
Respected sir,
In oracle we can populate the table data in csv file here if u see from our discussion that all fields are varchar expected result is in example of first post and table variable names are the first row of csv file if u can download
[Updated on: Tue, 15 December 2015 09:06] Report message to a moderator
|
|
|
|
| Re: Help with a command [message #645846 is a reply to message #645844] |
Tue, 15 December 2015 09:13   |
 |
vs140580
Messages: 70 Registered: December 2015
|
Member |
|
|
This is the SQL statement for create table sample with 4 coulmns
CREATE TABLE "SYSTEM"."SAMPLE"
( "E1" VARCHAR2(20 BYTE),
"E2" VARCHAR2(20 BYTE),
"E3" VARCHAR2(20 BYTE),
"E4" VARCHAR2(20 BYTE)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
where i have to pick 5 columns one answers result is
(0,1), (0,2), (0,3), (3,4)
(0,1), (1,3), (1,2), (2,4)
(0,2), (2,3), (1,2), (1,4)
(1,4), (2,4), (0,4),(0,3)
N+1 rows of N elements, such than there are N*(N+1) / 2 total elements, each duplicated twice.
Further more, the intersection of any two rows is exactly 1 element.
csv data for this is attached in first post i attach once more.
-
Attachment: sample.csv
(Size: 2.94KB, Downloaded 1238 times)
[Updated on: Tue, 15 December 2015 09:15] Report message to a moderator
|
|
|
|
|
|
|
|
| Re: Help with a command [message #645865 is a reply to message #645863] |
Tue, 15 December 2015 09:57   |
 |
vs140580
Messages: 70 Registered: December 2015
|
Member |
|
|
Expected result: is
N+1 rows of N elements, such than there are N*(N+1) / 2 total elements, each duplicated twice.
Further more, the intersection of any two rows is exactly 1 element.
remove all such possible N+1 rows from the table with N columns
in example we have to remove 5 rows as it has 4 coulumns
example output is
(0,1), (0,2), (0,3), (3,4)
(0,1), (1,3), (1,2), (2,4)
(0,2), (2,3), (1,2), (1,4)
(1,4), (2,4), (0,4),(0,3)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|