Hello,
I am running ubuntu16.04.
By means of @Rudic's help, I have below command.
What I need to do is to replace video_id by value of video_id in which WHERE
clause is matched:
{print "INSERT INTO video_series_files (id, video_id, file_type, protocol, \
url, languages, quality, accessed ,status )" \
" SELECT '." ++CNT ".', video_id, 'sub', 'custom', \
'http://localhost/test/" $1 "." $2 "." $3 "', 'a:1:{i:0;s:2:'" $2 \
"';}', '', '1', '1' FROM video_series_files WHERE url like '%" $1 "%.mkv';"}
video_id
is the name of column, video_id should be the value inside the same row when "WHERE" query matches.
I assigned variable as @video_id and then tried to grab
the value_id
but no luck :
{print "INSERT INTO video_series_files (id, video_id, file_type, protocol, url, languages, \
quality, accessed ,status )" \
" SELECT '." ++CNT ".', @video_id, 'sub', 'custom', \
'http://localhost/test/" $1 "." $2 "." $3 "', 'a:1:{i:0;s:2:'" $2 \
"';}', '', '1', '1' FROM video_series_files WHERE url like '%" $1 "%.mkv' \
AND SET @video_id=video_id IN (SELECT video_id FROM video_series_files \
WHERE url like '%$COL1%.mkv') ;" }
I'd appreciate your help
Thank you
Boris