CariDotMy

 Forgot password?
 Register

ADVERTISEMENT

View: 2234|Reply: 3

Update statement SQL

[Copy link]
Post time 19-12-2007 12:41 PM | Show all posts |Read mode
Nak minta tolong sesiapa yg familiar dengan SQL.

saya cuba cari x  jumpa2 camna nak buat.

contoh :
email address lama company : [email protected]
so, saya nak tukar kat table email semua pekerja jadi [email protected]..

kalu select ok,
select * table where email like '%abc.com.my'

tp nak update x tau camna...


TQ
Reply

Use magic Report


ADVERTISEMENT


Post time 19-12-2007 12:51 PM | Show all posts

Reply #1 Visual's post

cube gune ni

update table
set email =' [email protected]'
where email like '%abc.com.my'
Reply

Use magic Report

Post time 19-12-2007 03:24 PM | Show all posts
ehmm apa yg win paham ... ada sikit complicated .. sebab panjang email lain2 kan antara user ??
win bagi sample maybe Visual bleh try ..

update table_name
set column_email =
substr(column_email,1,length(column_email)-length(substr(column_email,-11,11)))||'@abcnet.com.my'

where column_email like '%abc.com.my'


yg length ngan substr tuh sbb ... panjang address email lain2 bagi setiap pengguna
cth :
[email protected] (length = 17)
[email protected] (length = 14)

jadi untuk update hanya address tanpa ganggu username maybe boleh guna cara yg win tepek tuh ...

so good luck ..
Reply

Use magic Report

 Author| Post time 19-12-2007 04:44 PM | Show all posts
terima kasih banyak2...

maybe saya try utk sorang dulu jadi ke x.

Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

 

ADVERTISEMENT



 

ADVERTISEMENT


 


ADVERTISEMENT
Follow Us

ADVERTISEMENT


Mobile|Archiver|Mobile*default|About Us|CariDotMy

5-1-2025 09:45 AM GMT+8 , Processed in 0.038052 second(s), 17 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

Quick Reply To Top Return to the list