-1

I currently have a SQL query like this:

SELECT `source`.`video_id` AS `video_id`, count(*) AS `count`
FROM (SELECT 
 *,
 (SELECT param.value.string_value 
 FROM UNNEST(event_params) AS param
WHERE param.key="content_type") as content_type,
 (SELECT param.value.string_value
 FROM UNNEST(event_params) AS param WHERE param.key="item_id") as video_id
FROM `analytics_275841270.events_*`, UNNEST(event_params) as event  
where event.value.string_value = 'v-academy') `source`
GROUP BY `video_id`
ORDER BY `count` DESC, `video_id` ASC
limit 5

which produces the following result:

sql n result

enter image description here

I want to remap my video_id into a string like "video26".

How do I concatenate the video_id with a static string?

Chris Albert
  • 2,462
  • 8
  • 27
  • 31

1 Answers1

0

If this is SQL Server, then you can use the CONCAT() function.

More can be found on this here.

You can simply write CONCAT('video', video_id) in the SELECT statement.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Ryan Garvey
  • 46
  • 12