2016-06-27 4 views
1

this my datagridview2, from contact.db that have 2 columns : no_tlp (telephone number), and Contact nameWie Wert in Datagridview Tabelle kombinieren mit benutzerdefinierten

and this is my datagridview1, from sms.db that have 3 columns : id_thread, address (phone no),body(sms text)

Ich möchte sowohl Datagridview kombinieren, damit sie zeigen können; id_thread, Kontaktnamen und Körper sms, werfen dann datagridview3

, aber ich habe ein Problem, dass die Telefonnummer in dataGridView1 & datagridview2 anderen Wert hat wie +62 und 0 (Ländercode),

i-Plan zu ändern alle 0 unter der Telefonnummer bis +62, und kombinieren beide, wo phone_no in Kontakt = phone_no in SMS

kann mir jemand helfen?

Antwort

0

für Änderung der PHP-Nummer können Sie

update contact 
set no_tlp = concat('+62', right(no_tlp, length(no_tlp) -1)) 
where no_tlp like '0%'; 

, sobald Sie die n_tlp aktualisieren ha Sie sowohl aus der Tabelle auswählen können

select contact.*, sms.* 
from contact 
inner join sms on contact.n_tlp = sms.address 
+0

Abfrage: Update tb_src_contact concat gesetzt no_tlp = ('+ 62' , rechts (no_tlp, Länge (no_tlp) -1)), wobei no_tlp wie '0%' Fehlercode: 1305 FUNCTION db_smsfor.lenght nicht existiert Ausführungszeit: 0 sec Transferzeit: 0 sec Gesamtzeit: 0.064 sec – jojodog

+0

verwendest du mysql? ... – scaisEdge

+0

Ich habe die Antwort aktualisieren .. Tippfehler – scaisEdge