How to avoid repeat values in two tables
hi there,
I have two tables. SUPPLIERS and MANUFACTURERS. SUPPLIERS has more than one MANUFACTURERS. In normalization rule, a field must have single piece of data. SUPPLIERS_ID is repeating for every MANUFACTURERS. pls help me out to normalize these two tables.
Thank u...
Ideally you need to have 2 master tables SUPPLIER & MANUFACTURER.
Then you need an intermediate transaction table to hold the relationship bet SUPPLIED & MANUFACTURER. Here the records will be repeated.
Similar Messages
-
How to copy the value of two tables into a view.
Hi Experts ,
I have a requirement in which i have been provided with two tables(T1,T2) of same table structure ,i need to copy their entries into a table view with the same structure as the two tables(T1,T2) .
suppose T1 has entries name age T2 has entries
A 20 D 40
B 30 E 46
C 40
the view should have all the entries,duplicate values no issues ...
Could you please suggest how can i do that ?
Thanks and Regards
Debashisif table have same structure then you can use
select * from t1
union all
select * from t2 -
How to avoid duplicates values from alvgird see below code
how to avoid duplicates values from alvgird see below code
in below query docno no is repeated again and again
how i can avoid duplication in this query.
select * into corresponding fields of table itab
from J_1IEXCHDR
inner join J_1IEXCDTL
on J_1IEXCDTLlifnr = J_1IEXCHDRlifnr
where J_1IEXCHDr~status = 'P'.Hi Laxman,
after that select statement
select * into corresponding fields of table itab
from J_1IEXCHDR
inner join J_1IEXCDTL
on J_1IEXCDTLlifnr = J_1IEXCHDRlifnr
where J_1IEXCHDr~status = 'P'.
<b>if sy-subrc = 0.
delete adjucent duplicates from itab comparing <field name of itab internal table>
endif.</b>
this will delete your duplicate entries.once you done with this call the alv FM.
<b> call function 'REUSE_ALV_GRID_DISPLAY'</b>
exporting
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'IT_USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
i_grid_title = 'Purchase Order Details'
I_GRID_SETTINGS = I_GRID_SETTINGS
is_layout = wa_layout
it_fieldcat = it_fieldcat
IT_EXCLUDING = IT_EXCLUDING
IT_SPECIAL_GROUPS = IT_SPECIAL_GROUPS
it_sort = it_sort
IT_FILTER = IT_FILTER
IS_SEL_HIDE = IS_SEL_HIDE
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT = IS_VARIANT
it_events = it_event
IT_EVENT_EXIT = IT_EVENT_EXIT
IS_PRINT = IS_PRINT
IS_REPREP_ID = IS_REPREP_ID
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS = IT_ALV_GRAPHICS
IT_HYPERLINK = IT_HYPERLINK
IT_ADD_FIELDCAT = IT_ADD_FIELDCAT
IT_EXCEPT_QINFO = IT_EXCEPT_QINFO
IR_SALV_FULLSCREEN_ADAPTER = IR_SALV_FULLSCREEN_ADAPTER
IMPORTING
E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER
ES_EXIT_CAUSED_BY_USER = ES_EXIT_CAUSED_BY_USER
tables
<b> t_outtab = ITAB</b>
exceptions
program_error = 1
others = 2
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
Thanks
Vikranth Khimavath -
How to display(binding) values in the table from more than one node?
Hi,
I have two nodes (TRIPS & AMOUNTS)in the context. How to bind these values into the table control?
When i bind second one, first one is getting replaced.Hi Mog,
Of course it is possible to create a table from attributes of more than one node, and in some cases this is still necessary, but you have to do this the hard (manual) way.
If you have a table control, have a look at the properties and the elements belonging to it.
First of all, there is the property "dataSource", which binds to a multiple node (let's name it TableRootNode). This means that for each element of THIS node, one row is created. In each row the data of exactly one element of this TableRootNode is displayed.
Then you have columns in this table. Inside of the columns there is a header and an editor. The editor is the interesting part.
Normally the primary property of this editor is bound to an attribute of the TableRootNode. Then everything works as expected. If it binds to an attribute of a subnode (SUB) of TableRootNode, then in row i the data of the subnode of the i-th element of TableRootNode is displayed. There is no need for SUB to be a multiple node, but it must not be a singleton.
If you bind a property of the editor to an attribute, which does not lie in the subtree of TableRootNode, then you will see the same value in each row.
Now it depends on the structure of your context. Take the node, which is relevant for the change in each row (I assume it is TRIPS) and bind the table to the node as you are used to. Then for each additional column, you have to create a new column in the tree, create a new header element with a title and a new editor (e.g. textview or inputfield) and then bind the right property of the editor to the corresponding attribute in node AMOUNTS).
If these 2 nodes do not have parent-child-relationship, the tip to create a new node, which consists of the attributes of both nodes is the only solution.
Ciao, Regina -
Avoid repeating values in details section
Hi,
I have a report with a lot of formulas - depending on certain values in a certain Oracle database table values are summed up.
The fields are therefore placed in the report footer.
As I now have to insert a grouping I need to move the fields into the details section. However, I don't want to display each value there but only the sum - I would like to avoid repeating values in the details section.
A formula looks like this:
stringvar A1;
if {OUR_TABLE_FIELD} = 1 then A1 := {OTHER_TABLE.OTHER_FIELD}
Else A1:=A1;
A1;
Thanks!Add a suitable group and then display data in this group footer, suppress detail section. It will effectively show the last detail line and thus eliminate duplicates from view. However, data is still there so if you want to use summaries you will need to use Running totals to ensure duplicates are not counted/summed
Ian -
Everyone is how to delete repeating values?
There is a column,values are repeated,everyone is how to delete repeating values?
Assuming that this set of numerical many, can not directly determine whether there is a duplicate value.
Thank you~
Message was edited by: Tao.
Message was edited by: Tao.Hi Tao,
I've found that a short AppleScript provides a convenient way to identify duplicates (repeating values) in a range.
Just select the range of cells you want to check for duplicates and click. It will turn the duplicates red.
--select range, run, turns duplicates red
tell application "Numbers" to tell front document to tell active sheet
set selected_table to first table whose class of selection range is range
tell selected_table
set selected_range to the selection range
tell selected_range
set values_list to {}
repeat with i from 1 to count cells
set this_value to value of cell i as text
if values_list contains this_value then set text color of cell i to "red"
set end of values_list to this_value
end repeat
end tell
end tell
end tell
--end of script
Just copy and paste the above script into AppleScript Editor, and run it from there. Or place it in your scripts menu. Or download this Automator Service (Dropbox download) and double-click it to install it in your Services menu.
Similarly, if you want to get a list of just the distinct values in a range (i.e. with duplicates removed) this Copy Distinct Automator Service (Dropbox download) is very convenient.
Select the cells, make the menu pick, then paste the distinct values wherever you want in a table by single-clicking a cell and typing command-v to paste.
These functions become, in essence, a customized menu. That way you don't have to set up formulas to do this each time you work with a new Numbers document.
SG -
How to retrieve the values from a table if they differ in Unit of Measure
How to retrieve the values from a table if they differ in Unit of Measure?
If no data is read
- Insure that you use internal code in SELECT statement, check via SE16 desactivating conversion exit on table T006A. ([ref|http://help.sap.com/saphelp_nw70/helpdata/en/2a/fa0122493111d182b70000e829fbfe/frameset.htm])
If no quanity in result internal table
- There is no adqntp field in the internal table, so no quantity is copied in itab ([ref|http://help.sap.com /abapdocu_70/en/ABAPINTO_CLAUSE.htm#&ABAP_ALTERNATIVE_1@1@]).
- - Remove the CORRESPONDING, so quantity will fill the first field adqntp1. ([ref|http://help.sap.com/abapdocu_70/en/ABENOPEN_SQL_WA.htm])
- - Then loop at the internal table and move the quantity when necessary to the 2 other fields.
* Fill the internal table
SELECT msehi adqntp
INTO TABLE internal table
FROM lipso2
WHERE vbeln = wrk_doc1
AND msehi IN ('KL','K15','MT').
* If required move the read quantity in the appropriate column.
LOOP AT internal_table ASSIGNING <fs>.
CASE <fs>-msehi.
WHEN 'K15'.
<fs>-adqnt2 = <fs>-adqnt1.
CLEAR <fs>-adqnt1.
WHEN 'MT'.
<fs>-adqnt3 = <fs>-adqnt1.
CLEAR <fs>-adqnt1.
ENDCASE.
ENDLOOP.
- You could also create another table with only fields msehi and adqntp and then collect ([ref|http://help.sap.com/abapdocu_70/en/ABAPCOLLECT.htm]) the data to another table.
Regards,
Raymond -
How to delete null values in a table
hi all,
tell me please any one how to delete null values in a table
example:
in emp table is there
empno ename job mgr sal deptno
7900 scott 7902 2000 10
7499 clerk 7900 20
7834 james manager 3000 30
like this in the above emp table there are some null values are there
so how to delete the null values in emp table
thanks,
regards.
Edited by: user9195968 on Feb 25, 2010 6:30 AMnot too sure what you mean, perhaps you could supply a table description and some sample data
but, consider
delete from table_1 where column_1 is null
commit
/ -
How to change default value in a table using ALTER TABLE
Hi,
How to change default value in a table
I have a table TEST which has 2 fields CODE of Datatype VARCHAR2(10) and Indicator as VARCHAR2(1).
I want to change the default value using ALTER TABLE TEST of field Indicator to 'I'.
Any help will be needful for me
Thanks and Regardsuser598986 wrote:
Hi,
How to change default value in a table
I have a table TEST which has 2 fields CODE of Datatype VARCHAR2(10) and Indicator as VARCHAR2(1).
I want to change the default value using ALTER TABLE TEST of field Indicator to 'I'.
ALTER TABLE test
MODIFY (indicator DEFAULT 'I');
Incidentally, INDICATOR is a keyword in Oracle, so you may have problems using it as a column name. If so, you'll have to enclose the column name in double-quotes, and be careful to use capital letters inside the quotes.
Edited by: Frank Kulash on Aug 26, 2009 11:42 AM -
In BADi , How to pass the values between two Method
Hi Experts,
We have two methods in BADis. How to pass the value between two Methods. Can you guys explain me out with one example...
Thanks & Regards,
Sivakumar SHi Sivakumar!
Create a function group.
Define global data (there is a similiar menu point to jump to the top include).
Create one or two function modules, with which you can read and write the global data.
In your BADI methods you can access the global data with help of your function modules. It will stay in memory through the whole transaction.
Regards,
Christian -
Need of SQL query in selecting distinct values from two tables
hi,
I need a query for selecting distinct values from two tables with one condition.
for eg:
there are two tables a & b.
in table a there are values like age,sex,name,empno and in table b valuses are such as age,salary,DOJ,empno.
here what i need is with the help of empno as unique field,i need to select distinct values from two tables (ie) except age.
can anybody please help me.
Thanks in advance,
RatheeshNot sure what you mean either, but perhaps this will start a dialog:
SELECT DISTINCT a.empno,
a.name,
a.sex,
b.salary,
b.doj
FROM a,
b
WHERE a.empno = b.empno;Greg -
How do we pass values and Internal tables to Sub-routines
how do we pass values and Internal tables to Sub-routines
Hi,
You can use the USING..or TABLES..or Changing addition..
Check this example.
DATA: T_MARA TYPE STANDARD TABLE OF MARA.
PERFORM DISPLAY USING T_MARA.
FORM DISPLAY USING LT_MARA LIKE T_MARA.
DATA: WA TYPE MARA.
LOOP AT LT_MARA INTO WA.
WRITE: / WA-MATNR.
ENDLOOP.
ENDFORM.
Thanks
Naren -
How to add integer value of two buttons?
how to add integer value of two buttons (any button) in VI and display it in output text box? i have attached example program, but i know its wrong.. please help
Solved!
Go to Solution.
Attachments:
add.vi 8 KBthanks for reply. i am trying to assign an integer value to a button and the button should send the assigned integer value to TCP/IP write, only when the button is pressed. i am able to send data using string control (as shown in the attachment) but i want to replace it with several buttons. for example, if i enter 2 in string control, this data will be sent to a robot (robot has wifi card) through tcp/ip protocol, it moves front. 3 will make it to move back, 8 is left, 6 is right. this numeric data is already burnt into blackfin processor of the robot. so just by entering numbers in labview can make my robot move in specified direction. can you please help me to create a button with value and convert it into string and send it to tcp/ip write. this should happen only when the button is pressed. because, if i enter numbers in string control, it dosent looks good..... if i have buttons... i think my VI will look good and hitech.
Attachments:
robo.vi 9 KB -
How to set default value of a table using sequence number
Dear all,
Does any body know that how to set default value of a table
using sequence number.
But I don't want to use trigger to do that.
Please help!!!!
EldonAndrew is essentially correct. You can get around the trigger,
but not the sequence, if (and this may be a very big if) you can
guarantee that every time an insert is done into the table, from
whatever source, the statement looks something like
INSERT INTO tbl VALUES (sequence.nextval,other_columns_values) -
How to avoid repeatation of code
hi
My code is as mentioned below.
if l_location ='USA'
insert into location
select f1,f2,f3,f4
from usa_tab
else if l_location = 'FRANCE'
insert into location
select f1,f2,f3,f4
from france_tab f , x1_tab x
where f.id = x.id
else if l_location = 'UK'
insert into location
select f1,f2,f3,f4
from uk_tab u,y1_tab y
where u.id = y.id
end if;
how to avoid the repeatation of code here?954992 wrote:
it is an existing application. The tables can not be changed.
actually here the insert and select statements are fixed , only the from and where conditions are getting changed.
howf to avoid repeatation of the fixed code?Oracle supports features called "+partition views+" and "+instead of triggers+". This can be used to glue tables (same structure) together and select and insert against these tables via a view.
Basic example:
// tables that constitutes the partition view - a check constraint on
// country is used to specify which cities are in which table, similar
// to a partition key
SQL> create table location_france(
2 country varchar2(10) default 'FRANCE' not null,
3 city varchar2(20) not null,
4 --
5 constraint chk_france check (country in 'FRANCE'),
6 constraint pk_location_france primary key
7 ( country, city )
8 ) organization index;
Table created.
SQL> create table location_uk(
2 country varchar2(10) default 'UK' not null,
3 city varchar2(20) not null,
4 --
5 constraint chk_uk check (country in 'UK'),
6 constraint pk_location_uk primary key
7 ( country, city )
8 ) organization index;
Table created.
SQL> create table location_spain(
2 country varchar2(10) default 'SPAIN' not null,
3 city varchar2(20) not null,
4 --
5 constraint chk_spain check (country in 'SPAIN'),
6 constraint pk_location_spain primary key
7 ( country, city )
8 ) organization index;
Table created.A partition view is a view that uses union all to glue these tables together:
SQL> create or replace view locations as
2 select * from location_france
3 union all
4 select * from location_uk
5 union all
6 select * from location_spain
7 /
View created.To support inserts against the partition view, an instead-of trigger is used:
SQL> create or replace trigger insert_location
2 instead of insert on locations
3 begin
4 case :new.country
5 when 'FRANCE' then
6 insert into location_france values( :new.country, :new.city );
7 when 'UK' then
8 insert into location_uk values( :new.country, :new.city );
9 when 'SPAIN' then
10 insert into location_spain values( :new.country, :new.city );
11 else
12 raise_application_error(
13 -20000,
14 'Country name ['||:new.country||'] is not supported.'
15 );
16 end case;
17 end;
18 /
Trigger created.Rows can now be inserted into the view and the trigger will ensure that the rows wind up in the correct table.
SQL> insert into locations values( 'FRANCE', 'PARIS' );
1 row created.
SQL> insert into locations values( 'UK', 'LONDON' );
1 row created.
SQL> insert into locations values( 'SPAIN', 'BARCELONA' );
1 row created.As with a partition table, a select on a partition view that uses the "partition column" (in this case, the COUNTRY column), the CBO can prune the non-relevant tables from the view and only select against the relevant table. In the following example, the UK is used as country filter and the CBO shows that only table LOCATION_UK is used.
SQL> set autotrace on explain
SQL> select * from locations where country = 'UK';
COUNTRY CITY
UK LONDON
Execution Plan
Plan hash value: 1608298493
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 19 | 1 (0)| 00:00:01 |
| 1 | VIEW | LOCATIONS | 1 | 19 | 1 (0)| 00:00:01 |
| 2 | UNION-ALL | | | | | |
|* 3 | FILTER | | | | | |
|* 4 | INDEX RANGE SCAN| PK_LOCATION_FRANCE | 1 | 19 | 2 (0)| 00:00:01 |
|* 5 | INDEX RANGE SCAN | PK_LOCATION_UK | 1 | 19 | 2 (0)| 00:00:01 |
|* 6 | FILTER | | | | | |
|* 7 | INDEX RANGE SCAN| PK_LOCATION_SPAIN | 1 | 19 | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
3 - filter(NULL IS NOT NULL)
4 - access("COUNTRY"='UK')
5 - access("COUNTRY"='UK')
6 - filter(NULL IS NOT NULL)
7 - access("COUNTRY"='UK')
Note
- dynamic sampling used for this statement (level=2)
SQL>Oracle provides a number of methods to address flawed data models and problematic client code. However, despite this flexibility on Oracle's part, you should still consider fixing the flawed design and code - as that flaws invariable mean reducing flexibility, performance and scalability.
Maybe you are looking for
-
Hi I have a macbook pro (late 2011) running on Yosemite and an iPhone 5s running iOS 8.1.2 and I have never had a problem until tonight. I wanted to sync my iPhone to add mew music but upon syncing I keep getting a pop up message saying "THE IPHONE
-
PLEASE HELP, iPhone bricked, but not in the 'usual' ways
I have a horrible problem with my iPhone, which usually I have been able to fix most iPhone problems. I've seen a lot of issues as I used to administer a 200 strong iPhone4 fleet, but this has me stumped! I have an iPhone4 GSM. Up until yesterday it
-
Breadth First Traversal of a Tree...
Hi, I want to make a program to print every node of a tree in a Breadth First Search (BFS)/Traversal. Since, BFS searches a tree in levels (i.e. 1st the root, then it's Children, then Grand Children etc from left to right), this is where I'm stuck. H
-
Change XControl direction: changing direction of child VIs
Hi, I'm writing an XControl containing several booleans, with a numert output based on which button is True, but I cannot change the direction of the Buttons when the direction of the XControl is changed in the VI using it: In the owning VI, in Edit
-
Hi Experts, I want to load data from 2LIS_11_VAKON with real time functionality. I made the real time flag enable in data source in r/3 side but while creating the info package in bi the real time flag is not showing. Could s'one please help me if i'