Searching multiple mysql tables, Joins?
I'm creating a mysql keyword search on my website and I know how to search a single mysql table, my problem is I need to search 15 different tables simultaneously, they also all have the same column names. I was told I have to you JOINS but i've never used them before. How is this done?
MY SQL SELECT:
SELECT *
FROM mytable1
WHERE keyword LIKE %colname% OR id LIKE %colname%
OK, that really doesn't answer my question. Just because they are in different categories is not a valid reason. Why can't they be mixed?
In any case, you could probably use a UNION query to solve the current problem, but I would have to know more about the complete query. You don't want to use a JOIN.
Similar Messages
-
Sql Problems, Same Field Names In Multiple Mysql Tables?
I have a keyword search that searches multiple DB tables for thumbnail images using UNION ALL. I have two pages, results.php, and view.php. My goal is to able to click a thumbnail image on results.php and be directed to a larger version of that same image on view.php. The problem is each image in all my tables uses the field name "id" so when I click a thumbnail on results.php I get two different images with the same id from different tables. I tried changing the id's to different names, but when it was time to pass url parameters I can only choose 1 value. (if you can choose more than 1 I don't know how). So my question is why are my id's from different tables being grouped together, and how can I change this?
Image Results Page (which works perfect):
SELECT *
FROM table1
WHERE keyword LIKE %colname% OR id LIKE %colname%
UNION ALL
SELECT *
FROM table2
WHERE keyword LIKE %colname% OR id LIKE %colname%
View Image Page (having problems here):
SELECT *
FROM table1
WHERE id = colname
UNION ALL
FROM table2
WHERE id = colnameYes, that is going to be a problem - and it's just the beginning of your problems when you do not normalize your data. Your data model is not correct. You should not be storing similar data in 15 tables - it's a really big mistake.
To solve your current problem you would need to include a table identifier in the query results in the Image results page, and pass that to the view page and then use PHP to dynamically create the SQL with the correct table....ugh! -
TREX - ECC 6.0 searches in different tables
Hi, have some search related questions:
- Is it possible to use TREX for combined searches from non-indexed tables in ECC 6.0 (where data is stored in different areas such as material, classification, BOM, customers, vendors, address data and so on)?
- Is it possible to mirror tables in ECC 6.0 to TREX via change pointers so the search data is "fresh" (the returned search result will be used in combination with other data and then stored back to ECC 6.0 from the NW portal)?
- Is it possible to have cross related search attributes (fields from material master, classification, bom, dms, address and so on) on the same tab in the sap standard search help (sap search help will be called from ABAP WebDynpro's)?
The main issue is to do combined searches with different combinations (number of input fields (10-20) related to different modules/areas) in ABAP WebDynpro. To do searches with outer table joins in tables without
keys and indexes seems not be doable.
/Brg Patrick OlssonHi lorenzo,
I have successfully installed ECC6.0 IDES SR2, i have found ECC-DIMP 6.0 LEVEL 6 in Support packs, please could you tell me that how can i activate IS-MILL in my server and what are the preconditions.
Thanks and Regards
ChandraB. -
Mysql query (search multiple tables in database)
I have 12 tables in a database - january through to december.
I need to search all 12 tables for 'keyworrd' phrases submitted by the user through a search form.
Must be a more streamlined way of doing it than below using 'UNION'. I have incorporated 2 tables in the below query but I need a more 'condensed' query for all 12 tables?
$sql = ('SELECT * FROM january WHERE tourTitle = "'.$keyword.'" UNION SELECT * FROM february WHERE tourTitle = "'.$keyword.'"');
Cheers
Osbregent wrote:
>That's what I did last year but thought I'd break it down this year into 12 easier to work with tables.
No, Ben is correct. Using 1 table for each month is absolutely the wrong way. It violates basic rules of normalization and causes all sorts of problems.
>Breaking it down appeals to be more so I can keep all the relevant months
>together instead of potentially becoming scattered throught-out one table.
That's what you use the Order By clause for.
>If by any chance the client says they want to update x, y or z I can go
>straight to the month in question without the necessity to flip through
>dozens of pages in phpMyAdmin as there is no real CMS management in place for this process.
Not sure what you are saying. Performing inserts, updates and queries is much simpler using a single table.
Whenever someone asks for a way to search through multiple tables, it tells me that the data structure is not designed well.
When I did this job last year there was about 60 pages created in phpMyAdmin. The records for January could be anywhere on those 60 pages as I may have to add additional records much later on in the process.
My thinking behind this was to keep all the month entries together so I could view them easily in phpMyAdmin.
Now due to my lack of knowlege about phpMyAdmin it could be possible to create a query to show only the january entries, I suspect it can do this.
I agree it is a lot simpler using 1 table to select and search through BUT I need if the ocassion arises to be able to view all the january or february entries etc one after the other, not 10 on page 2 and 3 on page 7 and 5 more on page 47 of phpMyAdmin.
So i quess what I really need is to write a select query in phpMyAdmin which only shows the selected entries for the month requested. I have not done much investigation into what phpMyAdmin can do........so I suppose I need to.
EDITED:
Arrgh you see IT WAS SO SIMPLE:
SELECT * FROM `tours` WHERE month = "March"
It's because I'm frightened of the bloody thing in case I mess something up! -
How can I search multiple columns in a SQL command of Union tables
Hi:
We have a database with tables that are nearly identical that we use for production and production history.
I have created an SQL command in Crystal 2008 to joins several of the tables and then added a "UNION" to connect the History and Prod tables.
I need to search multiple (3 total) columns for 5 different data types, to return the records being investigated. I tried this using an "OR" statement in the where clause and have had inconsistant results.
The first two or statement function perfectly the third works as long as the value being passed is numeric and the last two fail consistantly with invalid column name errors. It appears that crystal is getting confused and passing the wrong data type especially if I do a new search using a different option for the "?SearchParam"
Can some one offer some insite on how I can search these fields to return the record data needed
-- {?SearchParam} is the search parameter passed by Crystal that is a number 1 thru 5
-- {?Search_Val} is a parameter that is passed by Crystal that is a string of what to search for 1 = Numeric CMP ord #("TBSLI21"."LI21_OR_NO"), 2 = Numeric CI ord # ( "TBSLI33"."LI33_CI_OR_NO"),
-- 3 =String Ext Sys ord string ("TBSLI33"."LI33_EXT_SYS_SL_OR_NO"), 4 = String CMP Grp string ("TBSLI21"."LI21_OP_GRP_NO"), 5 = composit string PP ord string ("TBSOP13"."OP13_CLR_DAY" & "TBSOP13"."OP13_PP_GRP_SEQ_NO" & "TBSOP13"."OP13_CELL_ID")
SELECT "TBSLI21"."LI21_OR_NO",
"TBSLI21"."LI21_SH_DT_SCDL",
"TBSLI21"."LI21_TS_EN_ORIG",
"TBSLI21"."LI21_TS_SHIP",
"TBSLI21"."LI21_SYS_ORD_CD",
"TBSLI21"."LI21_SHIP_ID",
"TBSLI21"."LI21_WRKST_ID",
"TBSLI21"."LI21_LI_NO",
"TBSLI33"."LI33_CI_OR_NO",
"TBSLI33"."LI33_EXT_SYS_SL_OR_NO",
"TBSLI21"."LI21_OP_GRP_NO",
"TBSLI21"."LI21_LI_STAT",
"TBSOP13"."OP13_OP_GRP_STAT",
"TBSLI31"."LI31_LI_EV_DTL_TX",
"TBSLI31"."LI31_DT_EN",
"TBSLI31"."LI31_TM_EN",
"TBSLI31"."LI31_LI_EV",
"TBSLI21"."LI21_OP_WSH_FLNM",
"TBSLI21"."LI21_PR_ITF_CD",
"TBSLI21"."MFG_PLANT_CD",
"MFG_PLANT_LI"."MFG_PLANT_CD" as PrefPlant,
"TBSOP13"."OP13_OP_GRP_DSP_CD",
"TBSLI21"."LI21_LI_DSP_CD",
"TBSOP13"."OP13_CLR_DAY",
"TBSOP13"."OP13_PP_GRP_SEQ_NO",
"TBSOP13"."OP13_CELL_ID",
"MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG",
"TBSLI21"."LI21_OP_GRP_PS_NO1",
"TBSLI21"."LI21_POMS_MERGE_NO",
"TBSLI31"."LI31_OP_ID",
"TBSLI21"."LI21_LI_POR_FG",
"TBSLI21"."LI21_BIN_ID",
"TBSLI21"."LI21_TS_MRSHL",
"TBSLI33"."LI33_CI_LI_NO",
"TBSLI33"."LI33_SH_ADDR_1",
"TBSLI33"."LI33_SH_ADDR_2",
"TBSLI33"."LI33_SH_ADDR_3",
"TBSLI33"."LI33_SH_ADDR_4",
"TBSLI33"."LI33_SH_CITY_NM",
"TBSLI33"."LI33_SH_ST_NM",
"TBSLI33"."LI33_SH_ZIP_CD",
"TBSLI33"."LI33_CU_NM",
"TBSLI33"."LI33_CU_BUS_NM"
FROM ((("CMPREPORTING"."dbo"."TBSLI33" "TBSLI33" FULL OUTER JOIN "CMPREPORTING"."dbo"."TBSLI21" "TBSLI21" ON ("TBSLI33"."LI33_BS_OR_NO"="TBSLI21"."LI21_OR_NO") AND ("TBSLI33"."LI33_BS_LI_NO"="TBSLI21"."LI21_LI_NO")) LEFT OUTER JOIN "CMPREPORTING"."dbo"."TBSOP13" "TBSOP13" ON "TBSLI21"."LI21_OP_GRP_NO"="TBSOP13"."OP13_OP_GRP_NO") LEFT OUTER JOIN "CMPREPORTING"."dbo"."TBSLI31" "TBSLI31" ON ("TBSLI21"."LI21_OR_NO"="TBSLI31"."LI31_OR_NO") AND ("TBSLI21"."LI21_LI_NO"="TBSLI31"."LI31_LI_NO")) LEFT OUTER JOIN "CMPREPORTING"."dbo"."MFG_PLANT_LI" "MFG_PLANT_LI" ON ("TBSLI21"."LI21_OR_NO"="MFG_PLANT_LI"."OR_NO") AND ("TBSLI21"."LI21_LI_NO"="MFG_PLANT_LI"."LI_NO")
WHERE {?aSearchParam} = 1 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND "TBSLI21"."LI21_OR_NO"=Cast( {?Search_Val} as Int)
or {?aSearchParam} = 2 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND "TBSLI33"."LI33_CI_OR_NO"=Cast( {?Search_Val} as numeric(12,0))
or {?aSearchParam} = 3 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(20),"TBSLI33"."LI33_EXT_SYS_SL_OR_NO")= Convert( VarChar(20), {?Search_Val})
or {?aSearchParam} = 4 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(8),"TBSLI21"."LI21_OP_GRP_NO") = Convert( VarChar(8), {?GroupNo})
or {?aSearchParam} = 5 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(8), ("TBSOP13"."OP13_CLR_DAY" & "TBSOP13"."OP13_PP_GRP_SEQ_NO" & "TBSOP13"."OP13_CELL_ID")) = Convert( VarChar(8), {?GroupNo})
Union
SELECT "TBSLI21_HIST"."LI21_OR_NO",
"TBSLI21_HIST"."LI21_SH_DT_SCDL",
"TBSLI21_HIST"."LI21_TS_EN_ORIG",
"TBSLI21_HIST"."LI21_TS_SHIP",
"TBSLI21_HIST"."LI21_SYS_ORD_CD",
"TBSLI21_HIST"."LI21_SHIP_ID",
"TBSLI21_HIST"."LI21_WRKST_ID",
"TBSLI21_HIST"."LI21_LI_NO",
"TBSLI33_HIST"."LI33_CI_OR_NO",
"TBSLI33_HIST"."LI33_EXT_SYS_SL_OR_NO",
"TBSLI21_HIST"."LI21_OP_GRP_NO",
"TBSLI21_HIST"."LI21_LI_STAT",
"TBSOP13_HIST"."OP13_OP_GRP_STAT",
"TBSLI31_HIST"."LI31_LI_EV_DTL_TX",
"TBSLI31_HIST"."LI31_DT_EN",
"TBSLI31_HIST"."LI31_TM_EN",
"TBSLI31_HIST"."LI31_LI_EV",
"TBSLI21_HIST"."LI21_OP_WSH_FLNM",
"TBSLI21_HIST"."LI21_PR_ITF_CD",
"TBSLI21_HIST"."MFG_PLANT_CD",
"MFG_PLANT_LI_HIST"."MFG_PLANT_CD",
"TBSOP13_HIST"."OP13_OP_GRP_DSP_CD",
"TBSLI21_HIST"."LI21_LI_DSP_CD",
"TBSOP13_HIST"."OP13_CLR_DAY",
"TBSOP13_HIST"."OP13_PP_GRP_SEQ_NO",
"TBSOP13_HIST"."OP13_CELL_ID",
"MFG_PLANT_LI_HIST"."PRFR_MFG_PLANT_FLG",
"TBSLI21_HIST"."LI21_OP_GRP_PS_NO1",
"TBSLI21_HIST"."LI21_POMS_MERGE_NO",
"TBSLI31_HIST"."LI31_OP_ID",
"TBSLI21_HIST"."LI21_LI_POR_FG",
"TBSLI21_HIST"."LI21_BIN_ID",
"TBSLI21_HIST"."LI21_TS_MRSHL",
"TBSLI33_HIST"."LI33_CI_LI_NO",
"TBSLI33_HIST"."LI33_SH_ADDR_1",
"TBSLI33_HIST"."LI33_SH_ADDR_2",
"TBSLI33_HIST"."LI33_SH_ADDR_3",
"TBSLI33_HIST"."LI33_SH_ADDR_4",
"TBSLI33_HIST"."LI33_SH_CITY_NM",
"TBSLI33_HIST"."LI33_SH_ST_NM",
"TBSLI33_HIST"."LI33_SH_ZIP_CD",
"TBSLI33_HIST"."LI33_CU_NM",
"TBSLI33_HIST"."LI33_CU_BUS_NM"
FROM ((("CMPREPORTING"."dbo"."TBSLI33_HIST" "TBSLI33_HIST" FULL OUTER JOIN "CMPREPORTING"."dbo"."TBSLI21_HIST" "TBSLI21_HIST" ON ("TBSLI33_HIST"."LI33_BS_OR_NO"="TBSLI21_HIST"."LI21_OR_NO") AND ("TBSLI33_HIST"."LI33_BS_LI_NO"="TBSLI21_HIST"."LI21_LI_NO")) LEFT OUTER JOIN "CMPREPORTING"."dbo"."TBSOP13_HIST" "TBSOP13_HIST" ON "TBSLI21_HIST"."LI21_OP_GRP_NO"="TBSOP13_HIST"."OP13_OP_GRP_NO") LEFT OUTER JOIN "CMPREPORTING"."dbo"."TBSLI31_HIST" "TBSLI31_HIST" ON ("TBSLI21_HIST"."LI21_OR_NO"="TBSLI31_HIST"."LI31_OR_NO") AND ("TBSLI21_HIST"."LI21_LI_NO"="TBSLI31_HIST"."LI31_LI_NO")) LEFT OUTER JOIN "CMPREPORTING"."dbo"."MFG_PLANT_LI_HIST" "MFG_PLANT_LI_HIST" ON ("TBSLI21_HIST"."LI21_OR_NO"="MFG_PLANT_LI_HIST"."OR_NO") AND ("TBSLI21_HIST"."LI21_LI_NO"="MFG_PLANT_LI_HIST"."LI_NO")
WHERE {?aSearchParam} = 1 and "MFG_PLANT_LI_HIST"."PRFR_MFG_PLANT_FLG"='Y' AND "TBSLI21_HIST"."LI21_OR_NO"= Cast( {?Search_Val} as Int)
or {?aSearchParam} = 2 and "MFG_PLANT_LI_HIST"."PRFR_MFG_PLANT_FLG"='Y' AND "TBSLI33_HIST"."LI33_CI_OR_NO"= Cast( {?Search_Val} as numeric(12,0))
or {?aSearchParam} = 3 and "MFG_PLANT_LI_HIST"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(20), "TBSLI33_HIST"."LI33_EXT_SYS_SL_OR_NO")= Convert( VarChar(20),{?Search_Val})
or {?aSearchParam} = 4 and "MFG_PLANT_LI_HIST"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(8),"TBSLI21_HIST"."LI21_OP_GRP_NO")= Convert( VarChar(8), {?GroupNo} )
or {?aSearchParam} = 5 and "MFG_PLANT_LI_HIST"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(8), ("TBSOP13_HIST"."OP13_CLR_DAY" & "TBSOP13_HIST"."OP13_PP_GRP_SEQ_NO" & "TBSOP13_HIST"."OP13_CELL_ID")) = Convert( VarChar(8), {?GroupNo})This is actually a fairly easy fix - because of the way the "OR" works in SQL, you need to surround each "set" of statements in the or with parentheses. So, it would look something like this:
Where
({?aSearchParam} = 1 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND "TBSLI21"."LI21_OR_NO"=Cast( {?Search_Val} as Int))
or
({?aSearchParam} = 2 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND "TBSLI33"."LI33_CI_OR_NO"=Cast( {?Search_Val} as numeric(12,0)))
or
({?aSearchParam} = 3 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(20),"TBSLI33"."LI33_EXT_SYS_SL_OR_NO")= Convert( VarChar(20), {?Search_Val}))
or
({?aSearchParam} = 4 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(8),"TBSLI21"."LI21_OP_GRP_NO") = Convert( VarChar(8), {?GroupNo}))
or
({?aSearchParam} = 5 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(8), ("TBSOP13"."OP13_CLR_DAY" & "TBSOP13"."OP13_PP_GRP_SEQ_NO" & "TBSOP13"."OP13_CELL_ID")) = Convert( VarChar(8), {?GroupNo}))
-Dell -
Context index can't be used in complicated multiple tables join?
hello
thank you for view this page.
i have a comlicated sql :
SELECT count(*)
from
((app_AssetBasicInfo left join app_AssetBasicInfoExt on
app_AssetBasicInfo.id=app_AssetBasicInfoExt.id) left join
(app_AssetCustominfo1 left join app_AssetCustominfoExt1 on
app_AssetCustominfo1.id=app_AssetCustominfoExt1.id) on
app_AssetBasicInfo.id=app_AssetCustominfo1.id) WHERE
app_AssetBasicInfo.CategoryID=1 AND Del_tag=0 and contains(description,'department')>0;
the table app_AssetBasicInfo and app_AssetBasicInfoExt have multiple columns and large recoord size. i create a context index on app_assetbasicinfoext(description) which description is 4000 varchar2.
but the sql doesn't use context index. i suspect that the complicated multiple table join can't use context index? does it correct?
thanks very much!Could you please post an explain plan? I'm not quite sure what is the issue.
-
1. How to create an explain plan with rowsource statistics for a complex query that include multiple table joins ?
When multiple tables are involved , and the actual number of rows returned is more than what the explain plan tells. How can I find out what change is needed in the stat plan ?
2. Does rowsource statistics gives some kind of understanding of Extended stats ?You can get Row Source Statistics only *after* the SQL has been executed. An Explain Plan midway cannot give you row source statistics.
To get row source statistics either set STATISTICS_LEVEL='ALL' in the session that executes theSQL OR use the Hint "gather_plan_statistics" in the SQL being executed.
Then use dbms_xplan.display_cursor
Hemant K Chitale -
Join multiple fact tables and dimensions and use all tables in report issue
Hi,
I have a report requirements and need to use multiple fact tables and unconformed dimensions as described below
Fact table: F1,F2,F3
Dimensions tables: D1.....D9
F1:(joined to) D1,D2,D3,D4
F2::(joined to)D1,D2,D5,D6
F3::(joined to)D1,D2,D7,D8
D7::(joined to)D9,D8 (dimension D7 joined to two other dimensions D9 and D8
I'm trying to use columns from almost all the fact and dimension tables but getting "Unable to navigate requested expression. Please fix the metadata consistency warnings."
Repository is consistent and no errors and warnings.
How can I configure the repository to develop reports using all fact tables and dimensions?
Appreciate for your help.
Thanks
Jay.
Edited by: Jay on Feb 9, 2012 4:14 PMSo you want me to convert snowflake schema to star. does it solve my problem? individual star queries are working find but when I query multiple stars together getting inconsistency errors. I removed content tables dim level totals for unconformed dimensions in logical fact LTS and set level for measures at total level for unconformed dimensions. it is still in progress and need to test.
Thanks
Jay. -
Best approach to join multiple statistics tables into one
I have read different approaches to join multiple statistics tables into one, they all have a column "productobjectid".
I want to get all data for each product and put it to excel and output a jpg statistic with cfchart.
How would you do this, the sql part?
Thanks.A couple suggestions:
1) when joining tables, its best to list both table/fields that you are joining in the FROM clause:
FROM shopproductbehaviour_views INNER JOIN shopproductbehaviour_sails ON shopproductbehaviour_views.productobjectid = shopproductbehaviour_sails.productobjectid
2) You add tables to a SQL join by placing another join statement after the SQL above:
SELECT *
FROM TableA INNER JOIN TableB on TableA.myField = TableB.myField
INNER JOIN TableC on TableA.anotherField = TableC.anotherField
3) If you have columns in the tables that are named the same, you can use column aliases to change the way they appear in your record set:
SELECT TableA.datetimecreated 'tablea_create_date', TableB.datetimecreated 'tableb_create_date'
4) Certainly not a requirement, but you might want to look into using <cfqueryparam> in your where clause:
WHERE shopproductbehaviour_sails.productobjectid = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#all.productobjectid#">
You might want to consider checking out one of the many tutorials on SQL available online. Many of the questions you posed in your post are covered in pretty much every basic SQL tutorial. Alternately, a good SQL book is worth its weight in gold for a beginning web applications developer. -
Joins with multiple fact tables
Hi Experts,
i have one doubt in joins
we have two dimensions D1 and D2,
D1 is having A1 and A2 columns
D2 is having B1 and B2 columns
two facts F1 and F2 these are joined like D1 to F1 D1 to F2 and D2 to F1, D2 to F2
D1----->F1
D1------>F2
D2-------->F1
D2-------->F2
if i selected A1 and B1 in a request from which FACT table will get the data and why can you please explain
please help me
reg,
JellHi All,
I have a similar requirement where I have 4 multiple fact tables and we can't combine all those facts into one single fact table. In that case how can a query work with multiple common and uncommon dimensions and measures from multiple fact tables, if it doesn't work that way - can you please explain how can we expect a query to work with multiple fact tables.
For eg: D1– Dim
D2 – Dim
D3 – Dim
D4 – Dim
F1 –Fact
F2 – Fact
F3 – Fact
D1 -> F1
D2 -> F1,F2
D3 -> F2
D4 -> F1, F3
In this case if we want to query from D1,D2,D3, F1, F2 or D1,D2,D3,D4,F1,F2,F3. Kindly please explain how it can be modeled in BMM or what are the limitations. I have done with two fact tables in past and didn't had issues but this is kind of a vast implementation. Your help is appreciated. -
Multiple Fact Tables or Circular Joins?
I'm using OE schema to build an rpd, I'm importing foreign keys and I'm unable to decide which tables to be joined additional to the imported foreign key joins. If I'm not making any new joins I'm getting multiple fact tables and if I do make some joins I'm getting circular joins, some one please throw some light on this.
It is not a good idea to bring the OE schema tables as it is. The ideal approach would be to create a view that would represent the Fact table. For e.g this view could comprise of OE headers and OE line information and the reference id to the other dimensions.<br>
<br>
Similarly create views from customer table, item tables etc and then create a star schema surrounding the fact view with all these dimension views.<br>
<br>
-Nilesh<br>
Dashboard Development -
Joining Multiple facts to the multiple Dimension tables
Hi All,
We have multiple fact tables which are Joined to common Dimension tables. We join them in physical layer and maintain Left outer join in the BMM. I do not get any consistency errors. But when I run report I get error.
"could not find level detailed enough for group by clause" any suggestion on the same.
The join Strucutre is as follows.
Facts - F1, F2, F3
Dim - D1, D2, D3
F1 --> D1, D2, D3
F2--> D1, D2,
F3--> D1, D2, D3
We cannot combine F2, F3 into F1 using multiple Logical Table Source.
What is the best way to achieve the above mentioned functionality.
Please advice.
Regards,
Narendra Shetty.Check this
OBI Error While Running Query
Update us back with solution, if helps pls mark
Edited by: Srini VEERAVALLI on Dec 20, 2012 7:13 AM -
Table Join brings in multiple records
Hi guys,
I have created a table join for 2 HR master tables to get a view.
When i output the view however it brings in multiple records for each employee.
I have set PERNR as the Key field to join the tables but instead of giving me one instance of employee it picks it up 2 records....and in some cases many more, is their a fix for this?
ThanksHi,
Try using a combined primary key;
PERNR, BEGDA and ENDDA
There are more primary keys to be combined but try with this 3.
~BiSu -
Sample coding for multiple table join
Hi,
i need a sample coding for multiple table join. can anyone help me out.
regards
GokulSELECT AVBELN AFKDAT AVTWEG ASPART AWAERK AKURRF AKUNAG AKNUMV
BPOSNR BFKIMG BNETWR BMATNR
DBEGRU ELABOR E~MATKL
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM VBRK AS A INNER JOIN VBRP AS B
ON AVBELN EQ BVBELN
INNER JOIN J_1IEXCHDR AS C
ON AVBELN EQ CRDOC
INNER JOIN KNVV AS D
ON DKUNNR EQ AKUNAG AND
DVKORG EQ AVKORG AND
DSPART EQ ASPART AND
D~BEGRU NE SPACE
INNER JOIN MARA AS E
ON EMATNR EQ BMATNR
WHERE A~FKDAT IN S_FKDAT AND
A~FKART EQ 'F2' AND
A~VTWEG IN S_VTWEG AND
A~SPART IN S_SPART AND
A~KUNAG IN S_KUNAG AND
A~FKSTO NE 'X' AND
B~WERKS IN S_WERKS AND
C~TRNTYP = 'DLFC' AND
E~LABOR IN S_LABOR AND
C~SRGRP IN ('01','02','03','31','32','33','41','42','43',
'81','82','83','95','55','45', '48') AND
B~MATNR IN S_MATNR AND
D~BEGRU IN S_BEGRU AND
E~MATKL IN S_MATKL.
but my suggestion not to use more than 2 table in inner join it will affect in performance use for all entries instead of join.
regards
shiba dutta -
Fields missing from MYSQL table in Database Expert
I have just updgraded from Crystal XI to 2011 and I am still having issues with joining a mysql table to any other table.
Fields show up in field explorer but when I try to uise Database expert the only filed in the MYSQL table is the ID field.
Am I missing something here. Same problem with both versions. When I runa report using just the mysql table evrything works fine.Typically if the field doesn't show up the CR can't figure out what type it is which means when we query the DB for the field type the client/server returns the wrong type or some type that CR doesn't support.
How is the field defined on the server?
Thank you
Don
Maybe you are looking for
-
Thunderbolt to Firewire 800 Adaptors... any available?
Hi all, I'm probably going to buy a 15" Mac Book Pro whenever they are released later this year and have a strong suspicion that Apple will drop the Firewire 800 port in favour of Thunderbolt. I guess this really comes as no surprise but hopefully I'
-
Help! I Need to Downgrade!
I keep a souped-up Pismo that I use for work only. Recently I burned out the Wegener G4 processor (I think) when I didn't quite close the lid. Thing overheated and I've been getting kernel panics ever since. Replaced the two memory modules but that d
-
Java.lang.stackoverflowerror issue when calling another jframe
i created a login screen with a username/password field that i call from my main applicaton. I call the jframe with the following code createDirectories(); startNotes(); login.start(); getLists();once it gets to the login.st
-
How to Enable Obeject Creation in Oracle V8 ???
I have loaded Oracle on NT and whenever i try to create user defined datatypes it gives me a message saying that "Feature not elabled . Create type.. " Kindly give some information on how enable table partitioning in Oracle 8. null
-
Hi guru's, I want to implement image rotation functionality in Enterprise portal Note : Images are stored in KM Repository, on click of each image, it should take to different URL . Thanks in advance Regards Sadik