vendorID がベンダー テーブルの一意のキーである vendorID に基づいて、すべてのテーブルから共通のデータを表示する方法。そして、これを他のすべてのテーブル(コストテーブル、時間テーブル、従業員テーブル、一時テーブル、および)の外部キーとして使用します。
これは私のコスト テーブル構造です
これは私の時間テーブル構造
です これは私の 一時テーブル構造
です
これは私の従業員テーブルです
これは私のファイナルテーブル ベンダーです。vendorID は一意のキーです
そして、次のクエリを使用しましたが、別のデータが表示されています。
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