Mysql apply is made through the pipe