K
kikeman
Hi,
I have two tables that are liked with a relationship:
"Orders" and "Reports" with the OrderNumber column.
Orders Table (PK -> OrderNumber):
OrderNumber HoursForOrder
123456 47
876433 63
Reports Table (PK -> ID):
ID OrderNumber HoursWorked
4 123456 5
5 123456 4
6 876433 17
Question:
What would be the SQL SELECT command if I have the "ID" of a Report, and I
would like to get the "HoursForOrder" at the same time with a single command?
Since they are already linked I am wondering if should I really need to
execute two SELECT command (one SELECT to get the "OrderNumber" from
"Reports" and other SELECT to get the "HoursForOrder" from "Orders ") or only
one to get all data because the data is linked with a relationship.
Thanks,
Enrique.
I have two tables that are liked with a relationship:
"Orders" and "Reports" with the OrderNumber column.
Orders Table (PK -> OrderNumber):
OrderNumber HoursForOrder
123456 47
876433 63
Reports Table (PK -> ID):
ID OrderNumber HoursWorked
4 123456 5
5 123456 4
6 876433 17
Question:
What would be the SQL SELECT command if I have the "ID" of a Report, and I
would like to get the "HoursForOrder" at the same time with a single command?
Since they are already linked I am wondering if should I really need to
execute two SELECT command (one SELECT to get the "OrderNumber" from
"Reports" and other SELECT to get the "HoursForOrder" from "Orders ") or only
one to get all data because the data is linked with a relationship.
Thanks,
Enrique.