Month: July 2006

  • Quoth the maven

    Straight quotes can be used like backticks around aliases IN SOME CASES (as of 5.0.15, at least). Observe:

    CREATE TABLE myTable (id int, someData int);
    INSERT INTO myTable VALUES (1, 1), (1, 2), (1, 3), (2, 1), (2, 2);

    These three queries produce identical output:

    SELECT * FROM myTable GROUP BY id;
    SELECT * FROM myTable GROUP BY `id`;
    SELECT * FROM myTable GROUP BY 'id';

    (more…)