RE: Update Problem in CF
This should work with SQL Server update table1 set price = b.price from table1 a join table2 b on a.productid = b.productid and a.modelno = b.modelno > > I have two tables in a DB containing information about the same > > products. Table 1 is comprehensive and has complete details about > > the products. Table 2 has fewer no of fields. The fields common in > > both Table 1 and Table 2 are productid, modelno, price, details . > > > > Table1.price contains the old price. > > Table2. price is the latest price. > > > > I want to update Table1.price with the values in Table2.price and > > use modelno as the unique value for this update. > > > > Can someone please help. > > My SQL knowlede is very basic. > > Also what if Table two consists of new products not included in > > Table 1.? What syntax Should I use? > > > > > > Thanks > > JB > > > > > > > ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm
RE: Update Problem in CF
Update Table1 set Table1FieldName=(select Table2FieldName from Table2 where Table2ModelNo=123) where Table1ModelNo=123 This is the general idea... Joe Certified Advanced ColdFusion Developer [EMAIL PROTECTED] > -Original Message- > From: Srimanta [mailto:[EMAIL PROTECTED]] > Sent: Sunday, October 06, 2002 8:56 PM > To: CF-Talk > Subject: Update Problem in CF > > > Hi, > > I have two tables in a DB containing information about the same products. > Table 1 is comprehensive and has complete details about the products. > Table 2 has fewer no of fields. > The fields common in both Table 1 and Table 2 are productid, > modelno, price, > details . > > Table1.price contains the old price. > Table2. price is the latest price. > > I want to update Table1.price with the values in Table2.price and use > modelno as the unique > value for this update. > > Can someone please help. > My SQL knowlede is very basic. > Also what if Table two consists of new products not included in Table 1.? > What syntax Should I use? > > > Thanks > JB > > > ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
Update Problem in CF
Hi, I have two tables in a DB containing information about the same products. Table 1 is comprehensive and has complete details about the products. Table 2 has fewer no of fields. The fields common in both Table 1 and Table 2 are productid, modelno, price, details . Table1.price contains the old price. Table2. price is the latest price. I want to update Table1.price with the values in Table2.price and use modelno as the unique value for this update. Can someone please help. My SQL knowlede is very basic. Also what if Table two consists of new products not included in Table 1.? What syntax Should I use? Thanks JB ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm