Last post Aug 07, 2017 09:25 AM by Cathy Zou
Aug 05, 2017 03:40 PM|KatzIsLonely|LINK
I had 3 database table,
- Basic(ProjectTitle as primary key)
- Story(cusId as primary key)
- Details(CompanyName as primary key)
I need some help on the database query to join them together into one new database table called "Project" and all in one with unqiue ID of its own. Would appreciate it. Cheers
edit: sorry post on wrong section
Aug 05, 2017 04:17 PM|mgebhard|LINK
You need to rethink the approach. A story table with a custId as the primary key does not make sense nor do the other primary keys.
The best advice I can give you is to learn basic table design.
Aug 07, 2017 09:25 AM|Cathy Zou|LINK
I think you would merge three tables into one, but it is infeasible.
UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists.
The INNER JOIN creates a new result table by combining column values of two tables (table1 and table2) based upon the join-predicate. The query compares each row of table1 with each row of table2 to find all pairs of rows which satisfy the join-predicate. When
the join-predicate is satisfied, column values for each matched pair of rows of A and B are combined into a result row.
For more detail, you could refer to the following: