All pastes #969307 Raw Edit

Something

public text v1 · immutable
·published 2008-04-03 15:28 UTC
rendered paste body
Problem:
I want to display the newest instead of the oldest entry in `hits` as the information in the resulting table

Currently:
SELECT * FROM `ip2countries` AS `Ip2country`, `hits` AS `Hit` WHERE `Hit`.`ip2country_id` = `Ip2country`.`id` GROUP BY `Hit`.`countryCode` ORDER BY `Ip2country`.`country` ASC, `Hit`.`id` DESC

    <ip2countries>
        <id>73368</id>
        <ip_start>204.212.120.0</ip_start>
        <ip_end>204.212.127.255</ip_end>
        <num_start>3436476416</num_start>
        <num_end>3436478463</num_end>
        <cc>AW</cc>
        <country>Aruba</country>
        <id>176</id>
        <ipaddress>3436477019</ipaddress>
        <hostname>204-212-122-91.setardsl.aw</hostname>
        <ip2country_id>73368</ip2country_id>
        <countryCode>AW</countryCode>
        <created>2008-04-03 16:27:55</created>
        <httpUserAgent>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13</httpUserAgent>
        <httpReferer>http://www.example.com/index.php?cat=773</httpReferer>
        <serverName>www.example.com</serverName>
        <serverProtocol>HTTP/1.1</serverProtocol>
        <requestMethod>GET</requestMethod>
        <requesturi>/company_redirect.php?c=723</requesturi>
    </ip2countries>
    <ip2countries>
        <id>17193</id>
        <ip_start>69.73.209.0</ip_start>
        <ip_end>69.73.229.255</ip_end>
        <num_start>1162465536</num_start>
        <num_end>1162470911</num_end>
        <cc>BB</cc>
        <country>Barbados</country>
        <id>89</id>
        <ipaddress>1162469907</ipaddress>
        <hostname>69.73.226.19</hostname>
        <ip2country_id>17193</ip2country_id>
        <countryCode>BB</countryCode>
        <created>2008-04-03 16:14:12</created>
        <httpUserAgent>Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13</httpUserAgent>
        <httpReferer>http://www.google.com/search?q=recompensa+park+example&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:en-US:official&amp;client=firefox-a</httpReferer>
        <serverName>www.example.com</serverName>
        <serverProtocol>HTTP/1.1</serverProtocol>
        <requestMethod>GET</requestMethod>
        <requesturi>/index.php?cat=381</requesturi>
    </ip2countries>