Link to home
Start Free TrialLog in
Avatar of SayYou_SayMe
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.product_id
and sale.location_id=location_id
and move.location_id=location.location_id
 
sample-ERD.bmp
SOLUTION
Avatar of wilcoxon
wilcoxon
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SayYou_SayMe
SayYou_SayMe

ASKER

thanks guys

i use this SQL
select * from sale,product,location,move
where sale.product_id=product.product_id
and sale.location_id=location_id
and move.location_id=location.location_id


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




SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial