Supermetrics Support Forum

Solved

How to add a suffix to a column?

Hey all, I am new around here, and new to SQL/MySQL in general. 

I've have the plugin installed on Google Sheets and it has been super useful.

My issue is that I haven't been able to get the following command to work:

I want to basically, add a prefix to all of the first column (SteamID) and for it to update whenever the database updates. (I'm guessing I use the "UPDATE" syntax here,

here is what I have so far:


The command/s on line #1 work fine and I have no issue with that, but the command/s on line #2 are just not working for some reason:

http://prntscr.com/hm4e0v


Can anyone help me, all I want is for there to be the following prefix, before the numbers: (Prefix: https://steamcommunity.com/profiles/ )

(Row 3 is an example of what I want all of them to look like)

http://prntscr.com/hm4g15


Many thanks.

  • Hi!

    You should be able to use a simple concatenation operation to get what you are looking for. So unless the ID number is stored as an odd data type, this should work:


    SELECT

    CONCAT('https://steamcommunity.com/profiles/', steamid) AS SteamID,

    SteamName,

    CharName,

    TotalPlayTime

    FROM playerinfo

    ORDER BY TotalPlayerTime DESC


    You shouldn't need anything special for the update - every time you hit "refresh" it will re-execute this and update the data to match in the sheet.


    I hope this helps. Please let us know if you have any other questions.


    -Thank you

    Supermetrics Team


    1 person likes this
  • Hey, this works great now! Thank you so much for helping me. 



Login to post a comment