1

Ok so.. thoughts on MySQL,
SELECT max(column_name) from table_name;
Outputs the max value in the column by kinda traversing the whole column huh... Recursive🤔

While
SELECT concat(column_name) from table_name; outputs simple endl separated srrings. . .. no recursion. PHP backend sucks
😣

Comments
  • 0
    @irene ikr but if I wanna concat certain varchar column how am I gonna do it.. maybe "and" and "where"? Also am sry for including recursion it's giving a wrong sense instead it's linear traversing 🙈🙈
  • 5
    I don't get what you mean and what PHP has to do with it.
  • 0
    @gronostaj right!??

    @kkYrusobad Group_concat + group by
  • 1
    @kkYrusobad concat(..) is not aggregate function, so that query shouldn't work in the way you describe.
  • 0
    @gronostaj I saw max function implementation in php.. had a lot of loopholes 🙄
  • 0
    @kkYrusobad But what does it have to do with SQL? SQL is evaluated by DBMS, not PHP.
  • 3
    Max() is a calculation and only returns a single value.

    Concat() does exactly that, it concatenates values, best used with an alias.

    SELECT
    CONCAT(firstname, “ “, lastname) AS contact_name
    FROM users
    WHERE id = 1;

    These two functions have unrelated behaviours and should not be expected to do the same thing.

    While we are at it, MySQL is a skill of its own, typically used in PHP, but is not a PHP fault as to how these MySQL functions behave or are expected to work.
Add Comment