Friday, 23 August 2013

data show from 4 table mysql

data show from 4 table mysql

How to show the common data from all table on base of vendorID where
vendorID is unique key in my vendor table. and i use this as an foriegn
key for all other(cost table, hour table,employee table, temporary table
and ) table.
This is my Cost table struructre This is my Hour table structure This is
my Temporarytable structure This is my Employee table
This is my Final table vendor there are vendorID is unique Key
And i have use the following query but it is showing the different data.
SELECT * FROM cw_employee_csv as emp
inner join cw_cost_hour as cost on cost.vendorid=emp.vendorid
inner join cw_temp_employee as temp on cost.vendorid=temp.vendorid
inner join cw_hour_company as hour on temp.vendorid=hour.vendorid
inner join cw_vendor as vendor on temp.vendorid=vendor.vendorid
where vendor.companyid=1 ORDER BY hour.timeFrom ASC

No comments:

Post a Comment