Select statement formatting

前端 未结 1 1609
广开言路
广开言路 2021-01-28 00:52

I\'m trying to match up data from two tables. One is an invoices table with the date when a thing goes out and when it comes back in. The other is a line item table with each it

相关标签:
1条回答
  • 2021-01-28 01:30

    When using JOIN, always use the ON or USING (fields, ...) part of the syntax.

    In this case the field name in both tables was the same, invoice_number, so USING (invoice_number) was an appropriate syntax.

    If they where different names ON invoices.ID = line_item.invoice_number syntax could be used.

    Multiple conditions could be used so the criteria can be used in some ways like the the WHERE criteria of SQL.

    0 讨论(0)
提交回复
热议问题