×
Create a new article
Write your page title here:
We currently have 3,189 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,189Articles

    Mysql: Difference between revisions

    Content added Content deleted
    imported>mutante
    mNo edit summary
    imported>DrOwl
    No edit summary
     
    Line 4: Line 4:


    {{manpage}}
    {{manpage}}


    == Usefull hints ==
    Just some useful notes from different locations on the internet
    === Sort By IP address ===
    From O'Reillys MySQL Cookbook:

    SELECT ip FROM hostip
    ORDER BY
    SUBSTRING_INDEX(ip, '.', 1) + 0,
    SUBSTRING_INDEX(SUBSTRING_INDEX(ip, '.', -3), '.', 1) + 0,
    SUBSTRING_INDEX(SUBSTRING_INDEX(ip, '.', -2), '.', 1) + 0,
    SUBSTRING_INDEX(ip, '.', -1) + 0;

    or (MySQL 3.23.15 an above)

    SELECT ip FROM hostip
    ORDER BY INET_ATON(ip);

    Latest revision as of 14:25, 30 November 2011

    Also see: MySQL

    <man>mysql</man>

    see also: mansearch, man2html


    Usefull hints[edit]

    Just some useful notes from different locations on the internet

    Sort By IP address[edit]

    From O'Reillys MySQL Cookbook:

    SELECT ip FROM hostip
    ORDER BY
    SUBSTRING_INDEX(ip, '.', 1) + 0,
    SUBSTRING_INDEX(SUBSTRING_INDEX(ip, '.', -3), '.', 1) + 0,
    SUBSTRING_INDEX(SUBSTRING_INDEX(ip, '.', -2), '.', 1) + 0,
    SUBSTRING_INDEX(ip, '.', -1) + 0;
    

    or (MySQL 3.23.15 an above)

    SELECT ip FROM hostip
    ORDER BY INET_ATON(ip);
    
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.