You are here: Help with Statement « PHP SQL « IT news, forums, messages
Help with Statement

Posted by Brian on 04/18/07 22:44

Hi all

I know this can be done, just not sure how

I have 2 tables of orders, table A ("summary") has 1 line of info per order
(a summary the orders)
table B ("full_orders") has the full details of orders, this is a one to
many relationship

I have been asked to take the "invoice_number", and "invoice_date" from the
"summary" table and add it
to the matching fields in the "full_orders" matching it by a field called
"dnote", I just can't think of how to do it.

I know there is a join in here somewhere but I just can't get mat head
wrapped round it, I could rite a script to loop
though this but there has to be a better way.

What I am trying to say is this

Start at being of summary table and loop though each row
Get "invoice_number", "invoice_date" and "dnote", from "summary" table
UPDATE "full_orders" SET invoice_number = summary.invoice_number,
invoice_date = summary.invoice_date WHERE dnote = summary.dnote
end loop

Can anybody help

Brian

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация