BuchBerechnete Spalte (Microsoft SQL Server 2014)
| B_ID | Name | Unit_Price|
|------+---------+-----------|
| B01 | Math | 25 |
| B02 | Science | 34 |
Bestellen
| O_ID | B_ID | Quantity |Total_Price|
|------+------+-----------+-----------|
| O01 | B01 | 2 | ? |
| O02 | B02 | 5 | ? |
Wie kann ich die Total_Price durch Order.Quantity
Multiplikation und Book.Unit_Price
wo Order.B_ID
ein FK ist Book.B_ID
. Vielen Dank!
Überprüfen Sie das Bild in diesem Link. Sie werden eine klare Vorstellung von Joins haben. Das wird Ihnen helfen, diese Art von Abfragen zu verstehen. http://stackoverflow.com/questions/35349303/php-compare-two-tables-and-store-result-in-thir-table/35349429#35349429 – Mytroy2050
@ Mytroy2050 danke! –