Jump to content

Beginner question


aleniko

Recommended Posts

Hi all;

I have the following statement to create a temporary table:

 

mysql_query("create temporary table curdist1

  select acct,name,address1,address2,krccust.city,krccust.state,krccust.zip,krccust.tel,zips.lat,zips.lon,termtype,web,shpadrs1,shpadrs2,shpcity,shpstate,shpzip

                from krccust left join zips on left(krccust.zip,6)=zips.zip")  ;^M

 

After the table is created, I need to go through it and change every record which has the phrase "P.O." in the name field. I need to replace the information in the name,address1,address2,city,state,zip with the corresponding shpname,shpadrs1,shpadrs2,shpcity,shpstate,shpzip for all the records which have "P.O" in the name field.

Can someone let me know what's the syntax for that?

 

Also, I would like to know if this is achievable withing the original select statement.

 

Thanks!

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.