I have a little trouble with a MySQL query, I have two tables tb_user and tb_trx and the last one is the result which I'm trying to do
What I want to do is to show id_user from tb_user which have level = 0 and if id_user in tb_trx have status = 0 more than equals 2, they will not appear in result.
Welcome to StackOverflow. We would normally expect you to show us what you have tried so far, as this is not a code writing service. But have a go with this (N.B. I haven't tested it):
select u.id_user from tb_user u where u.level = 0 and (select count(*) from tb_trx t where t.id_user = u.id_user and t.status = 0) <= 2
Incidentally I don't think your data set would properly test the rule you have given (which I may have misunderstood, your statement of it is pretty unclear).