Please clarify what information is pulled and how it is reorganized using CONCAT vs CONCAT_WS in SQL. See example below for more details.
For example,
CONCAT('Google', '.com') creates Google.com
but I don't understand how
CONCAT_WS ('.', 'www', 'google', 'com') also create Google .com
To me it seems like it would create .wwwgooglecom
Why is this not the case?
For example,
CONCAT('Google', '.com') creates Google.com
but I don't understand how
CONCAT_WS ('.', 'www', 'google', 'com') also create Google .com
To me it seems like it would create .wwwgooglecom
Why is this not the case?
CONCATjust combines the values provided as arguments as it is. For example -CONCAT('www','.google','.com')produceswww.google.comCONCAT_WSwill combine the provided values based on the separator, which is the first argument. For example -CONCAT_WS('.', 'www','google','com')will producewww.google.com.