Skip to content
Advertisement

How to get data from sub-table?

i have “transaction” table and it has date_of_transaction, transaction_number, item_number columns. it has rows. also i have “item” sub-table. they linked with “item_number”. there are item_name and item_category columns for “item” table. i want to print rows with item_name and transaction_number. how can i make it?

Advertisement

Answer

select transaction_number, item_name
from transaction t 
join item i on t.item_number = i.item_number

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement