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 |
SELECT url, SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(url, '/', 3), '://', -1), '/', 1), '?', 1) AS domain, SUBSTRING_INDEX(SUBSTRING_INDEX(REPLACE(url, '//', '.'), '/', 1), '.', -2) AS domain2 FROM ( SELECT 'http://testdomain.com' as url UNION SELECT 'https://testdomain.com' UNION SELECT 'http://testdomain.de/foo.bar/fold-test.html' UNION SELECT 'http://testdomain.de/foo' UNION SELECT 'http://testdomain.de/?foo' UNION SELECT 'https://testdomain.de/foo' UNION SELECT 'https://testdomain.de/?foo' UNION SELECT 'http://testdomain.de?http://anotherdomain.de' UNION SELECT 'testdomain.de' UNION SELECT 'testdomain.de/foo' UNION SELECT 'testdomain.de/foo/' UNION SELECT 'testdomain.de/foo?param=baz' UNION SELECT 'testdomain.de/foo/?param=baz' UNION SELECT 'testdomain.de/foo/bar' UNION SELECT 'testdomain.de/foo/bar/' UNION SELECT 'testdomain.de/foo/bar/?param=baz' UNION SELECT 'testdomain.de/foo/bar/three' UNION SELECT 'testdomain.de/foo/bar/three?u=http://anotherdomain.de' UNION SELECT 'http://sub.testdomain.de' UNION SELECT 'sub.testdomain.de/foo' UNION SELECT 'sub.sub.testdomain.de/foo' ) AS Testtable; |
Folgende Artikel könnten auch interessieren
- MySQL RAM Tables
- MySQL PROCESSLIST
- Hilfreiche SQL Queries für Shopware
- Was sind temporäre Tabellen bei MySQL und wie konfiguriert man diese richtig?
- Performancesteigerung von MySQL durch Optimierung der Queries
- Pentaho Open Source Business-Intelligence-Software
- MySQL: NOT IN , NOT EXISTS oder LEFT JOIN mit IS NULL Abfrage?
- MySQL: Daten per Datei ein- und auslesen
- MySQL und der Datum/Zeit Vergleich
- MySQL Query Optimierung: Alle Einträge holen die doppelt vorhanden sind
- MySQL Queries mit EXPLAIN auswerten und das Ergebnis richtig deuten
- MySQL Queries – Tips und Tricks
- MySQL Profiling Syntax
- MySQL Performance Optimierung durch richtiges Konfigurieren
- MySQL Performance Optimierung
- MySQL Performance Erfolge
- MySQL Performance Cheat Sheet
- MySQL Monitoring & Profiling
- MySQL Indexe richtig setzten
- MySQL Fachwissen