Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@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 🙈🙈
-
@kkYrusobad concat(..) is not aggregate function, so that query shouldn't work in the way you describe.
-
@kkYrusobad But what does it have to do with SQL? SQL is evaluated by DBMS, not PHP.
-
C0D4681386yMax() 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.
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
😣
question