to do this out of the box with SQL, you need to create the subset first by sql then update the resulting query. In my example the subset is named a_is_0, you could use another name, or simply use the last query in the update dialog when selecting table to update. observe data types, if fielda is character use quotes, if numeric, no quotes
Select * from mytable where a = 0 into a_is_0 then update a_is_0, col to update is a, with Value -1 here is a test I ran on one of my tables copied from the mapbasic window. I queried a subset of the field zoning for R3A, then used the update table wizard to update another field (sort) from 0 to 1 Select * from Zoning where ZONING="r3A" into Selection Browse * From Selection Update Query2 Set sort = 1 Browse * From Query2 William "Woody" Woodruff Zoning Administrator Charter Township of Union, Isabella County, Michigan -84.80947000 43.61095100 2010 S Lincoln Rd, Mt. Pleasant, MI 48858 (989) 772 4600 EXT 41 - FAX (989) 773 1988 Visit our web site at http://www.geocities.com/ctuzoning/index.htm -----Original Message----- From: Richard Block [mailto:[EMAIL PROTECTED] Sent: Monday, June 27, 2005 11:20 AM To: [email protected] Subject: MI-L A simple question How do I update a column with an "if" or "for" statement? eg. if fielda = 0 replace fieldA with -1 THanks for your help Dick Richard Block Department of Sociology Loyola University 6525 N Sheridan Rd. Chicago IL 60626 Telephone 773 508 3454 FAX 773 508 7099 email [EMAIL PROTECTED] --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 16958 --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 16996
