|
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 #1 Visual's post
cube gune ni
update table
set email =' [email protected]'
where email like '%abc.com.my' |
|
|
|
|
|
|
|
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 .. |
|
|
|
|
|
|
|
terima kasih banyak2...
maybe saya try utk sorang dulu jadi ke x.
|
|
|
|
|
|
|
| |
|