SQL:
1
2
3
4
5
6
| SELECT h1.Plaats, h2.Beschrijving FROM Hardware h1, Hardware h2 WHERE h1.Type = 'Computer' AND h2.Type = 'Primary IP Address' AND CONCAT( h1.Plaats, '$', h1.ID ) = h2.Plaats |
Mijn database-tabel zit als volgt in elkaar:
code:
1
2
3
4
5
6
7
| Type varchar(100) ID int(11) Plaats text Serial text Opmerking text Beschrijving text Tijd bigint(20) |
En een voorbeeldje van de data ziet er zo uit:
code:
1
2
3
4
| Type ID Plaats Serial Opmerking Beschrijving Tijd Computer 1 Persoon1 NULL Microsoft Windows 98 Microsoft Windows 98 4.10.1998 (Win98 Retail) 1057847904 Primary IP Address 1 Computer$1 10.55.63.212 1057847904 Computer 2 Persoon2 NULL Microsoft Windows 98 SE Microsoft Windows 98 SE 4.10.2222A (Win98 SE) 1057848051 |
Het probleem hiermee is dat hij niets als retour geeft.
Als ik die concat eraf laat zet hij bij elke persoon, elk ip adres. Wat dus niet het juiste is. Als ik die concat alleen laat lopen zie ik dat hij die perfect concat ... Dus ik weet nie juist waar ik hier iets verkeerd aan doe... Kan er iemand daar zijn lichtje op laten schijnen?