Combine two tables without common field
Hi Experts,
I have two database tables, DBSTATORA(stores inform about all the tables involved in infoproviders), and RSDODSO ( stores information about ODS Objects. I have to list the ods objects and its associated tables as the output, but there is no common field in these two tables how will i combine these two tables, can anyone please suggest me. Any help will be fine.
thanks,
Prabhu.
Hi Everyone,
I know the ods tables names are stored like /bix/a<ods_name>00 and /bix/a<ods_name>40 and for change log it is /bic/b*. But my requirement is I have to display the size of the tables belonging to a particular ods object. So for all the tables the size is stored in DBSTATTORA which gives information about
DBSTATTORA
fields of this tables are:
TNAME --> Table Name
ANDAT --> Analyzing Date
AMETH --> Analysis method for collecting Statistics
NROWS --> No of rows in a table
OCCBL --> Used blk(size) of table in KB
EMPBL --> Empty blk(size) of table in KB
AFREE --> Avg Freespace in a used db block
INDBS --> Used Blk(size) of an index kb
This is a table which stores the statistics information.
It displays all the tables of infocubes and ods objects, but does tell that this table belongs to this infoprovider.
I have to display data from this table as well as the infoprovider to which it belongs. So there is no proper information of database tables where the infocube and its associated tables like the facttable, dimtables are stored together. Same for the ods objects also.
There are for ods object RSDODSOTABL which give information about ods object and the table name is stored differently <ods_name>_0000. How do i map this table with the DBSTATTORA table, the tablenames doesn't match. Same problem with RSTSODS table which give informaiton about change log table.
And also for infocubes, there is RSDCUBE which gives information about infocubes but not the associated tables. So does anyone know where all these information is stored in some database tables. It would be of great help.
Thanks a lot.
Prab
Similar Messages
-
Combining two tables without any distinct columns between them
Folks,
Hi sidy2j,
According to your description, we need to verify your table structures, and the actual results which you want to get from your tables. Please post more information for analysis.
Assume, if you want to a one to one record mapping between two tables without any common column between them for joining, you can refer to the following scripts to implement your requirement. For more information, see:
http://sqlhints.com/2013/09/07/joining-two-tables-without-any-common-column-between-them-sql-server/
If you want to match every row in the first table with every row in the second table, you can refer to the following detail.
http://stackoverflow.com/questions/1198124/combine-two-tables-that-have-no-common-fields
Hope it can help you.
Regards,
Sofiya Li
Sofiya Li
TechNet Community Support -
Data fetch from two table without refresh
hi Friends,
I have a problem i want to extract data from two table without refresh into text field when i'll enter any value in a text field then corressponding value should come in to corressponding textfield.
eg. there two table A and B.
Table A has Colunm
s_id Number;
c_id Varchar2(30);
sec varchar2(4);
Second Table B Colunm Name
s_id Number;
f_name varchar(30);
l_name varchar(20);
when i enter s_id 101 in a text field then the c_id ,sec,first_name and last_name should come in to corressponding text fields without refresh.
How Can I do this.
Thanks
ManojHi Manoj,
You have to make an Ajax call to display data without refreshing the page. Search this forum for Ajax and you can find lots of related posts. This link might help too. http://www.dba-oracle.com/t_html_db_apex_ajax_application_express.htm
Thanks,
Manish. -
Query for Linking Two Tables without Reference
Hi Folks,
Good Day!
I have this dilemma on how to link two tables without a reference. In the Business Partner Master Data, there is a field for the Territory which is from the table OTER. This OTER focuses on its description. Once you have added the particular Territory for that Business Partner, it is being stored in the Territory field of the BP right? Our client wants to have an automated way of searching for the Business Partner's Profit Center in creating a Sales Order wherein it is the same as the Business Partner's Territory. The Profit Center is from the table OPRC.
When I create a Sales Order, after I have entered the Business Partner/Customer Code, the Profit Center should have the value of the Profit Center Code wherein it is the Business Partner's Territory. My query will go like this:
Enter the BP/Customer Code automatically the Profit Center code where Profit Name = BP's Territory.
OTER and OCRD don't have connections. How can it be?
I'm thinking of retrieving the Territory first before the Profit Center but can you suggest of any other way?
Thank you much!
Regards,
FringeHi Fringe,
Okay, I already understood your case here. I presume your configuration as follows:
OTER (Territory)
territryID - descript
1 - Philippine
2 - Indonesia
3 - Germany
OPRC (Cost Centre)
PrcCode - PrcName
25 - Philippine
33 - Indonesia
47 - Germany
Was above illustration correct? Then, you could use this formatted search in Cost Centre / Dimension field in Sales Order rows
SELECT PrcCode FROM OPRC WHERE PrcName=(
SELECT TOP 1 descript FROM OTER T0
INNER JOIN OCRD T1 ON T0.territryID=T1.Territory
WHERE T1.CardCode=$[OCRD.CardCode.0])
However, I suggest you use a little bit different approach here. Since you can't define Territory Code / Territory ID (you could only type the Territory name, Philippine etc.), why don't you standardize Territory name with Cost Centre code? Let say, you define Philippine as PHI, Indonesia as INA, Germany as DEU and so on. Therefore, user can read the Cost Centre or more precisely Distribution Rules in Sales Order form in more familiar way.
OTER (Territory)
territryID - descript
1 - PHI
2 - INA
3 - DEU
OPRC (Cost Centre)
PrcCode - PrcName
PHI - Philippine
INA - Indonesia
DEU - Germany
When FMS worked in Sales Order document, your user will read PHI instead of 25, should be more familiar to them. With that being said, you could use simpler FMS
SELECT descript FROM OTER T0
INNER JOIN OCRD T1 ON T0.territryID=T1.Territory
WHERE T1.CardCode=$[OCRD.CardCode.0]
You only need to maintain consistency between Territory Name and Cost Centre code. Just my two cents. Hope this help.
Best Regards,
Hendry Wijaya -
Combinig two tables without a JOINER
Hi,
I got a little problem. I want to combine two tables. But I don't need a joiner, cause that would give me wrong combined values.
I have a table working_hours which has the actual working hours of employees. And a table times_absent which has the absent time of the employees.
Both tables have the date and actual hours of work and absent besides other tings in it.
I simple want to combine these two tables to one big table.
Example:
Table working_hours :
Name --- Date --- Hours -- ....
Mr.A --- 2.5.2011 --- 8 --- ...
Mr.B --- 2.5.2011 --- 6 --- ...
Mr.C --- 2.5.2011 --- 7 --- ...
Table times_absent:
Name --- Date --- Days --- ....
Mr.A --- 3.5.2011 --- 1 --- ...
Mr.B --- 3.5.2011 --- 2 --- ...
Mr.B --- 4.5.2011 --- 2 --- ...
New Table:
Name --- Date --- Working_Hours --- Absent_Days ---
Mr.A --- 2.5.2011 --- 8 ---- null - or some sort of dummy value XXX
Mr.A --- 3.5.2011 --- null --- 1 ---
Mr.B --- 2.5.2011 --- 6 --- null ---
Mr.B --- 3.5.2011 --- null --- 2 ---
Mr.B --- 4.5.2011 --- null --- 2 ---
and so one.
Is there a possibility in the OWB to perform such task?
thxAs MccM says you need to make the columns in your IN groups the same i.e. the same structure as your new table.
Connect WORKING HOURS to IN GROUP 1 and ABSENT to IN GROUP 2 for the columns that exist.
Create a numeric CONSTANT with a default value of NULL and connect that to ABSENT_DAYS in IN GROUP 1 and WORKING_HOURS in IN GROUP 2.
You don't need to change the structure of your tables. -
Combining two tables into one result
Hi all, I am fairly inexperienced with Crystal but have gained good results from the reports I have created, I am fluent in SQL and Basic to an extent. I am interigating a Pronto database and I want concatenate two tables into one report.
Table One: Customer Orders
Fields: Customer No, Invoice Number, Invoice date, Invoice Amount, Cost Amount.
Table Two: Archived Customer Orders
Fields: Customer No, Invoice Number, Invoice date, Invoice Amount, Cost Amount.
I want to complete a report that will tell me the sales for a given period and the outstanding orders for each customer total for all fields in each table combined into one figure.
Any help would be greatly appreciated.
Thanks in advanceHi Grant,
As you said you are goot at writing SQL, in Crystal write a SQL statement in Add Command to join both table using Union / Union all
If you use Union then it will filter duplicate records and pull the data from database, If you use Union All then it will include all your duplicate records. Please use Union / Union All as required.
Once you get all data into the report create a parameter for date range and generate the summaries as required.
Thanks,
Sastry -
Display columns from two tables without making join
Hi,
I need to perform currency conversion in the report.
For eg:) Whatever the currency in ar_payment_schedules i want to
convert it to INR equivalent.
Following is the query to do this.
select ps.invoice_currency_code Currency_B,
decode(ps.invoice_currency_code, 'INR',ps.amount_due_original,
round(ps.amount_due_original*
ps.exchange_rate,
curr.precision)
from
ar_payment_schedules ps,
fnd_currencies curr
where ps.customer_id = '111'
and curr.currency_code = 'INR'
When i do this in the Administration tool, the answers modules erroring out saying
that no joins between ar_payment_schedules and fnd_currencies. But here join is
not needed becuase fnd_currencies is filtered with INR and will return only
one row. Without joining two tables how can i get the same results in Answers.
thanks,
PrasannaIf it would return only one row then what is the need for the join (is it just for returning the precision?). Cant you just hard code the precision value instead of getting it from the table? Also you are doing a cartesian join, though the filters would take care of the final output this would result in a bad performance as your data starts scaling out. You need to find a key to join these 2 tables. If you do not have one, then just create a view with the cartesian join alone and then use that in your report.
Thanks,
Venkat
http://oraclebizint.wordpress.com -
Loading source tables without common columns using owb
Dear All,
I have 5 tables say a,b,c,d,e who has no columns between any of these tables .but i need to poulate some of the columns in each table as per my requirement and
i need to load into my target table which needs the above tables source columns data .
how can we achieve this as we dont have any columns across 5 tables.
regards
rajeshSame thread .
Loading source tables data without common columns in owb
Please close it.
Edited by: Nawneet on May 18, 2009 11:06 AM -
Join two tables without index scan
Hi All,
I have two tables (ProgramMaster, ProgramDetails). ProgramMaster have very less number of records and Programdetails have large number of records
My Query is
Please vote if you find this posting was helpful or Mark it as answered.Saravanan,
As you may know, usage of functions over the columns will force the compiler to go for a SCAN and not a SEEK. How about rewriting the query (without using functions) to make way for better usage of the index.
One option is to make use of a calendar table that would prove to be effective for date operations like this one..
For more info on calendar table:
http://www.allaboutmssql.com/2014/01/sql-server-calender-details.html
http://social.technet.microsoft.com/wiki/contents/articles/22776.t-sql-calendar-table.aspx
http://blog.jontav.com/post/9380766884/calendar-tables-are-incredibly-useful-in-sql
Thanks,
Jay
<If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'> -
Question about combining two tables
I have two tables that I want to combine them together:
Table A: ID x
49 3
127 1
Table B: ID y
49 1
83 2
127 1
Expected combined table C: ID x y
49 3 1
83 0 2
127 1 1
Seems I have to do two out join and them union them together. Any better ways?
Thanks
garyThe tables are not displayed properly. try it again:Use the {noformat}{noformat} tag for that.
Put it before and after your example.
So, when you type or paste your formatted code like this:
{noformat}select *
from dual;{noformat}
it will appear as:select *
from dual;on this forum -
JOIN question... Join two tables without omiting rows
I ran into a problem that should have an easy solution (I hope), but I'm having a hard time coming up with a solution.
Basically, I have two tables, one with actual amounts and one with the budget. I am to write a sql select statement that joins these tables together and includes all of their rows. I've been able to join the tables together using JOIN, LEFT JOIN, and RIGHT JOIN, but it always omits rows that I need.
Below, I have examples of my tables (AMOUNT_TABLE and BUDGET_TABLE). For simplicity sake, I've built the examples to show the same values in the first four columns, with the 5th and 6th columns (SUB_ACCOUNT, AMOUNT, BUDGET) as the only values that are different. My actual tables aren't quite as simple, but I didn't think it was relavent for this question.
AMOUNT_TABLE
FISCAL_YEAR
PERIOD
ACCT_UNIT
ACCOUNT
SUB_ACCOUNT
AMOUNT
2013
1
11111
555555
0000
100
2013
1
11111
555555
1000
100
2013
1
11111
555555
2000
100
2013
1
11111
555555
3000
100
2013
1
11111
555555
4000
100
BUDGET_TABLE
FISCAL_YEAR
PERIOD
ACCT_UNIT
ACCOUNT
SUB_ACCOUNT
BUDGET
2013
1
11111
555555
3000
200
2013
1
11111
555555
4000
200
2013
1
11111
555555
5000
200
2013
1
11111
555555
6000
200
Here is the output I'm hoping for. Notice that SUB_ACCOUNTs 0000, 1000, and 2000 show amounts with no budget since there isn't a matching row in the BUDGET_TABLE. And likewise, for SUB_ACCOUNTs 5000 and 6000, they show budgets with no amounts since there isn't a matching row in the AMOUNT_TABLE.
(output)
FISCAL_YEAR
PERIOD
ACCT_UNIT
ACCOUNT
SUB_ACCOUNT
AMOUNT
BUDGET
2013
1
11111
555555
0000
100
0
2013
1
11111
555555
1000
100
0
2013
1
11111
555555
2000
100
0
2013
1
11111
555555
3000
100
200
2013
1
11111
555555
4000
100
200
2013
1
11111
555555
5000
0
200
2013
1
11111
555555
6000
0
200
Hopefully, my question is clear. Any help on this would be greatly appreciated. Thanks in advance.Use ANSI join syntax - FULL OUTER JOIN:
with amount_table as (
select 2013 fiscal_year,1 period,11111 acct_unit,555555 account,0000 sub_account,100 amount from dual union all
select 2013,1,11111,555555,1000,100 from dual union all
select 2013,1,11111,555555,2000,100 from dual union all
select 2013,1,11111,555555,3000,100 from dual union all
select 2013,1,11111,555555,4000,100 from dual
budget_table as (
select 2013 fiscal_year,1 period,11111 acct_unit,555555 account,3000 sub_account,200 budget from dual union all
select 2013,1,11111,555555,4000,200 from dual union all
select 2013,1,11111,555555,5000,200 from dual union all
select 2013,1,11111,555555,6000,200 from dual
select nvl(a.fiscal_year,b.fiscal_year) fiscal_year,
nvl(a.period,b.period) period,
nvl(a.acct_unit,b.acct_unit) acct_unit,
nvl(a.account,b.account) account,
nvl(a.sub_account,b.sub_account) sub_account,
nvl(a.amount,0) amount,
nvl(b.budget,0) budget
from amount_table a
full join
budget_table b
on (
a.fiscal_year = b.fiscal_year
and
a.period = b.period
and
a.acct_unit = b.acct_unit
and
a.account = b.account
and
a.sub_account = b.sub_account
FISCAL_YEAR PERIOD ACCT_UNIT ACCOUNT SUB_ACCOUNT AMOUNT BUDGET
2013 1 11111 555555 0 100 0
2013 1 11111 555555 1000 100 0
2013 1 11111 555555 2000 100 0
2013 1 11111 555555 3000 100 200
2013 1 11111 555555 4000 100 200
2013 1 11111 555555 6000 0 200
2013 1 11111 555555 5000 0 200
7 rows selected.
SQL>
SY. -
I have the following two tables:
Asset_Issued
Asset_Type_ID
Assigned To
1
Ram
2
Ram
3
Ram
4
Ram
5
Ram
1
Raju
3
Raju
5
Raju
1
Rajesh
3
Rajesh
2
Rajesh
Asset_Type
Asset_Type_ID
Asset_Name
1
Laptop
2
Desktop
3
Mouse
4
Keyboard
5
Monitor
Can anyone help me with the query that will give the following result.
Asset_Issued_Count
Asset_Name
Count
Laptop
3
Desktop
2
Mouse
3
Keyboard
1
Monitor
1I think your OUTPUT COUNT for MONITOR should be 2 and not 1. Try the below.
WITH ASSET_ISSED(ASSET_TYPE_ID,ASSIGNED_TO) AS(
SELECT 1,'Ram' FROM DUAL UNION ALL
SELECT 2,'Ram' FROM DUAL UNION ALL
SELECT 3,'Ram' FROM DUAL UNION ALL
SELECT 4,'Ram' FROM DUAL UNION ALL
SELECT 5,'Ram' FROM DUAL UNION ALL
SELECT 1,'Raju' FROM DUAL UNION ALL
SELECT 3,'Raju' FROM DUAL UNION ALL
SELECT 5,'Raju' FROM DUAL UNION ALL
SELECT 1,'Rajesh' FROM DUAL UNION ALL
SELECT 3,'Rajesh' FROM DUAL UNION ALL
SELECT 2,'Rajesh' FROM DUAL),
ASSET_TYPE(ASSET_TYPE_ID,ASSET_NAME) AS
(SELECT 1,'Laptop' FROM DUAL UNION ALL
SELECT 2,'Desktop' FROM DUAL UNION ALL
SELECT 3,'Mouse' FROM DUAL UNION ALL
SELECT 4,'Keyboard' FROM DUAL UNION ALL
SELECT 5,'Monitor' FROM DUAL)
SELECT ASSET_NAME,
COUNT(1)
FROM
ASSET_ISSED T1,
ASSET_TYPE T2
WHERE T1.ASSET_TYPE_ID=T2.ASSET_TYPE_ID
GROUP BY T2.ASSET_NAME;
OUTPUT:
ASSET_NA COUNT(1)
Desktop 2
Laptop 3
Mouse 3
Keyboard 1
Monitor 2 -
Can I combine two partitions without losing data on one?
So if I have two partitions on one hard drive can I combine them without losing the data that is on one of them? If not, could I just do a time machine backup, combine the two partitions, and then restore the time machine backup? Would that work?
If the other partition was created with BootCamp it can be deleted in Bootcamp and merged back into OS X.
It might be possible to rename the partition "BOOTCAMP" in Disk Utility and formatted MSDOS to trick Boot Camp into thinking it is a Bootcamp parititon and merging it back into OS X. (haven't tried this so I don't know if it works or not yet) I would first make a clone below before attempting this method.
TimeMachine restores are fraught with problems on these forums.
What I would do in your case is use another equal or larger sized (than your primary boot drive), blank, Disk Utility HFS+Journaled formatted, external powered drive to Carbon Copy Clone your OS X boot partition to it, then Disk Utility > Repair Permissions on both (you can ignore the list that shows).
What this does is gives you a "hold the option key" bootable clone, which while booted from it, check it out first and then use Disk Utility to completey (select the hard drive name) format the entire primary boot drive (HFS+ Journaled of course).
Then simply CCC back onto the primary boot drive. Then run ALL of OnyX's maintainence and cleaning aspects and reboot. Speedy machine here we come. (note: Cloning optimizes the drive by the order of the alphabetical order files in the Root Level, leaving "Users" last where the most change and slowdown in drive performance occurs, OnyX cleans out the caches and rebuilds Spotlight, more performance)
http://www.titanium.free.fr/
The new version of CCC has gotten a bit more complicated, including a archiving of files changed from between updated clones, however the default settings are fine for your first time clone to a blank drive. So all you really have to do is select the "From" and "To" drives and click Clone.
Clones are wonderful, it's a exact copy of whats on your primary boot drive, so far in the many years I've used clones everything has worked on the same machine, everything.
TimeMachine drives are not bootable, leaving you stuck if your hard drive dies or you can't boot from the OS X install disks.
You can first make a clone so you have that method, then c boot off the 10.6 installer disk and use TimeMachine that way to restore to the newly formatted drive (use Disk Utility under the Utilities menu, second screen in) I haven't tried this myself, prefering clones instead as it's less headaches.
Remmeber to ALWAYS have two backups of your data at all times, (erasing your drive leaves you with only one copy) in this case you would have a clone and a TM backup, in case one method fails (less likely the clone), then you got the other method. -
SAP R/3 Tables without Date fields
I am trying to import data from SAP R/3 into MS SQL DWH.
There are tables which doesnot have posting date fields.
Can anyone tell me how to map them with those Table which will have posting date fields, so i can create view in SAP and then pull that view into SQL DWH restricting on date.
Following tables which doesnot have date fields i want to pull date for month of July 2007;
EKBE
EKKO
MAKT
MSEG
KSEG
AFPO
JEST
JCDS
MARA
AUFK
COEP
RESB
MARC
I am not a ABAP developer just trying to get my data from SAP, so please answer in detail.BUDAT is the technical name for Posting Date field. This field is used many DB Tables/ Strucutres. Using where used option you can find the required tables.
I suggest you to look at BSEG table for Finace Document postings by Posting Date. -
How to build a query to join on two tables without mapping
I did Automatic mapping by the workbench Directofield mapping with the table and java object.
Wanted to build a simple join query by joining on the same field on both the tables.Not the sql query through the toplink using expression builder.
Please help.............
Spent one full day for this................Thanks Don for the reply,sorry to bug you,but i need help.....
SELECT A.AGNCY_C,
A.TYPE_C,
A.RESN_C,
A.S_TYPE_C,
A.SUB_ID_C,
A.RY_C
FROM RATING A, REF B
WHERE A.ID_C = B._ID_C
AND A.ALPHA_C = B.ALPHA_C
AND A.EFF_D >= B.MATURITY_D
This is the real query i was talking about.I did mapping automatically through the workbench,generated java classes also throught the workbench.
Now they don't want to execute the raw sql.They wanted to get all the RATING objects with the where condition.
So how to build a query by using toplink.
tried your example
ExpressionBuilder builder = new ExpressionBuilder();
Expression creditRating = builder.getTable("RATING").getField("ID_C");
Expression issue_ref = builder.getTable("REF").getField("ID_C");
Expression join = creditRating.equal(issue_ref);
I am getting java.lang.OutOfMemoryError
error.
I selected the option generate classes and descriptors
from the tables (RATING,REF).,so it created the classes and dscriptors automatically.
In Database script for the table RATING like this
ALTER TABLE RATING ADD (
CONSTRAINT RATING_F1 FOREIGN KEY (ID_C, ALPHA_C)
REFERENCES REF (ID_C,ALPHA_C));
I think when i generate descriptor automatically it is keeping this association.
Please help me.........
Maybe you are looking for
-
Since it is a secure site, I cannot copy the page to the desktop for you to view. There is a column of choices on the left hand of the screen that is not visible on this notebook (LG ES30) which is a week old. The page works fine on this machine in I
-
Variable binding with javafx.ext.swing.SwingSlider
My first javafx program consists of a slider and a text box, the text box displays the current value of the slider. The problem is the text box does not display anything when the program just starts up, but only gets populated once I change the value
-
24p rookie! Needs help!
So I'm not completely new to FC, but I've always shot 29fps and used FCE. I am now in the process of editing a feature (in FCP) that was shot on a DVX100. The footage was shot in 24p and a 16:9 ratio. I was wondering if someone could help me with wha
-
Why am I Observing Poor Geospatial Query Performance?
Our HANA Rev. 72 Amazon instance is performing very poorly when selecting geospatial polygons from tables. I'm hoping someone out there knows why. Here's one example. The table below has just 51 records; one for each state (includingPuerto Rico). T
-
Table which gives Cost Elements allocated to Activity Types
Hii Experts, I need to know the table which gives the Activity types along with the respective GL/Cost Elements attached to them. Can anyone help me where to look at the table. I see i can get the Activity types with Cost Centers, Cost Centers with C