FAQ |
Kalender |
![]() |
#1 | ||
|
|||
Klarade millennium-buggen
|
Nån som kan skriva om följande sql-kod till en ordentlig joinad?
Kod:
select cref_host from hit where site=75 and date > \'2007-08-26\' and cref_host not in (select cref_host from hit where site = 75 and date < \'2007-08-26\' group by cref_host) group by cref_host Kod:
select a.date,a.cref_host,b.cref_host from hit a, hit b where a.site = 75 and a.date >= \'2007-08-26\' and b.site = 75 and b.date < \'2007-08-26\' and b.cref_host = a.cref_host group by a.cref_host order by a.date desc Kod:
select a.date,a.cref_host,b.cref_host from hit a, hit b where a.site = 75 and a.date >= \'2007-08-26\' and b.site = 75 and b.date < \'2007-08-26\' and b.cref_host = a.cref_host and b.cref_host is null group by a.cref_host order by a.date desc Det jag vill uppnå är alltså att plocka fram alla rader som har skapats sedan 2007-08-26 men inte finns tidigare i databasen. Nya rader dvs. |
||
![]() |
![]() |
|
|