Reuben Porter
01/27/2022, 3:53 PMconcat
query. Basically we have a user’s table with FirstName
and lastName
, and we’re using a `contains`/`LIKE` search.
I.e if I search “Nathan” it will search firstName and lastName columns for “Nathan”, and if it finds it, return the row(s), great! Likewise if I search “Sainsbury”, it will return the row.
However, should I search “Nathan Sainsbury” I would find no results as “Nathan Sainsbury” is not contained with “Nathan” or “Sainsbury”.
In SQL I’d be able to do something like:
select * from "User"
where concat("firstName", ' ', "lastName") LIKE '%Nathan Sainsbury%';
Is there anyway to do this in Prisma without a raw query?