5 Einträge, 1 Seite |
SELECT Ticket.CalledNumber, IPtoGS.PhoneNumberLike FROM Ticket JOIN IPtoGS ON (Ticket.CalledNumber = IPtoGS.PhoneNumberLike)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
mysql> CREATE TABLE tbl_Test1(
-> ID INT,
-> Phone VARCHAR(35));
Query OK, 0 rows affected (0.01 sec)
mysql>
mysql> CREATE TABLE tbl_Test2(
-> ID INT,
-> Vorname VARCHAR(36),
-> PhoneLike VARCHAR(29));
Query OK, 0 rows affected (0.00 sec)
mysql> insert into tbl_Test1 values(1,123456);
Query OK, 1 row affected (0.00 sec)
mysql> insert into tbl_Test1 values(2,7235);
Query OK, 1 row affected (0.00 sec)
mysql> insert into tbl_Test2 values(1,'Teutales',1234);
Query OK, 1 row affected (0.00 sec)
mysql> select * FROM tbl_Test1, tbl_Test2 WHERE tbl_Test1.Phone like CONCAT(tbl_Test2.PhoneLike,'%');
+------+--------+------+----------+-----------+
| ID | Phone | ID | Vorname | PhoneLike |
+------+--------+------+----------+-----------+
| 1 | 123456 | 1 | Teutales | 1234 |
+------+--------+------+----------+-----------+
1 row in set (0.00 sec)
1
2
3
4
5
6
7
mysql> SELECT * FROM tbl_Test1 JOIN tbl_Test2 ON tbl_Test1.Phone LIKE CONCAT(tbl_Test2.PhoneLike,'%');
+------+--------+------+----------+-----------+
| ID | Phone | ID | Vorname | PhoneLike |
+------+--------+------+----------+-----------+
| 1 | 123456 | 1 | Teutales | 1234 |
+------+--------+------+----------+-----------+
1 row in set (0.00 sec)
5 Einträge, 1 Seite |