itrabbi24
6 days ago

Mysql Qurey to Laravel Qurey Like %% Problem

Posted 6 days ago by itrabbi24

SELECT tmsid, RIGHT(tmsid,6) as max_number FROM tms_tables WHERE tmsid=(SELECT MAX(tmsid) FROM tms_tables where tmsid LIKE '%1001%' )

How To Convert This to laravel?

if I do like that give me error "A non-numeric value encountered"

DB::select(DB::raw('SELECT tmsid, RIGHT(tmsid,6) as max_number FROM tms_tables WHERE tmsid=(SELECT MAX(tmsid) FROM tms_tables where tmsid LIKE '%1001%' )'));

Please sign in or create an account to participate in this conversation.