Einzelnen Beitrag anzeigen

omata

Registriert seit: 26. Aug 2004
Ort: Nebel auf Amrum
3.154 Beiträge
 
Delphi 7 Enterprise
 
#12

Re: SQL Stringfunktionen

  Alt 31. Jan 2010, 17:28
SQL-Code:
SELECT j.*,
       j.time2 - j.time1 AS diff1,
       j.time3 - j.time1 AS diff2,
       bis
FROM (SELECT ip
      FROM data
      GROUP BY ip
      HAVING COUNT(*) > 1) b
INNER JOIN (SELECT *, CHARACTER_LENGTH(ip) - POSITION('.IN REVERSE(ip))+1 AS bis
            FROM data) j
  ON SUBSTRING(b.ip FROM 1 FOR bis) = SUBSTRING(j.ip FROM 1 FOR bis)
  Mit Zitat antworten Zitat