Including local variable in concat string in MySQL
<p>I'm looking to take a specified string and query a table where a concat of 2 fields is equal to the string.</p>

<pre><code>set @fab = "36013-601301-11";
set @job = substring_index(@fab, '-', 1);
set @fabnumba = trim(leading LEFT(@fab,char_length(@job)+1) from @fab);

select * from (select JobNumber, concat(JobNumber, '-', LotNumber) as bomfab from qiw_powerbi) base
where bomfab LIKE concat(@job,"-", @fabnumba)
</code></pre>

<p>If I try the following it fails:</p>

<pre><code>WHERE bombfab LIKE "36013-601301-11"
</code></pre>

<p>However, this attempt works:</p>

<pre><code>WHERE bombfab LIKE "36013-%601301-11"
</code></pre>

<p>How can I concat() with the variables @job and @fabnumba to do this?</p>