Comments
1 comment
-
Hi Janez,Now, if write the following query (join of the first table with the second and the third):
select * from Visit v
inner join VisitProduct vp
on v.Visit = vp.Visit and v.Employee = vp.Employee
inner join VisitCustomer vc
on v.Visit = vc.Visit and v.Employee = vc.Employee
the SQL Prompt offers me the correct join condititon when I type the join statement for the table VisitProduct (second table). But, when I am typing join for the third table, SQL Prompt only offers me the join condition between the VisitProduct (second table) and VisitCustomer (third table), but it does not offer me the join condition between Visit (first table) and VisitCustomer (third table).And even the join condititon offered between the second and the third table only consists of only one field (e.g. vp.Visit = vc.Visit) and not the complete key.
Regards,
Tilman
Add comment
Please sign in to leave a comment.
I have some troubles with Prompt when joining multiple tables. Let's say that I have three tables: Visit, VisitProduct and VisitCustomer.
Visit table has the following PK:
Visit (number of the visit)
Employee (employee code)
VisitProduct has the following PK (first two fields are FK from Visit table):
Visit
Employee
Product (product code)
VisitCustomer has the following PK (first two fields are FK from Visit table):
Visit
Employee
Customer (customer code)
Now, if write the following query (join of the first table with the second and the third):
select * from Visit v
inner join VisitProduct vp
on v.Visit = vp.Visit and v.Employee = vp.Employee
inner join VisitCustomer vc
on v.Visit = vc.Visit and v.Employee = vc.Employee
the SQL Prompt offers me the correct join condititon when I type the join statement for the table VisitProduct (second table). But, when I am typing join for the third table, SQL Prompt only offers me the join condition between the VisitProduct (second table) and VisitCustomer (third table), but it does not offer me the join condition between Visit (first table) and VisitCustomer (third table). And even the join condititon offered between the second and the third table only consists of only one field (e.g. vp.Visit = vc.Visit) and not the complete key.
Any help?
Janez