A Database Error Occurred

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by rand() limit 3' at line 7

select p.*,concat(tc1.des_tag,'/',t.des_tag) as des_tag from tb_produto p inner join tb_tag t on t.idi_tag = p.idi_tag inner join tb_categoria c1 on c1.idi_categoria = p.idi_categoria inner join tb_tag tc1 on tc1.idi_tag = c1.idi_tag where p.flg_publicado = 1 and p.flg_ativo = 1 and p.idi_categoria = order by rand() limit 3