SayYou_SayMe
asked on
how to update a specific record in the relational tables
I have 4 tables:
sale
location
product
move
when inserting a record, will use the uniq location_id , product_id to insert into 2 tables: sale and move
--the requirement is that select a product_name and location_id to search all related records in the database.
--and then can select an individual record to update it
issue, i can get 1 more sale_id and move_id when joining these tables, it is hard to pick the record to update.( we are using .net at fron_end)
select * from sale,product,location,move
where sale.product_id=product.pr oduct_id
and sale.location_id=location_ id
and move.location_id=location. location_i d
sample-ERD.bmp
sale
location
product
move
when inserting a record, will use the uniq location_id , product_id to insert into 2 tables: sale and move
--the requirement is that select a product_name and location_id to search all related records in the database.
--and then can select an individual record to update it
issue, i can get 1 more sale_id and move_id when joining these tables, it is hard to pick the record to update.( we are using .net at fron_end)
select * from sale,product,location,move
where sale.product_id=product.pr
and sale.location_id=location_
and move.location_id=location.
sample-ERD.bmp
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i use this SQL
select * from sale,product,location,move
where sale.product_id=product.pr
and sale.location_id=location_
and move.location_id=location.
IS THE SAME AS
select * from sale
left join product on product.product_d = sale.product_id
left join location on location.location_id = sale.location_id
left join move on move.location_id = sale.location_id