phildeman has asked for the wisdom of the Perl Monks concerning the following question:
Hi All,
I am having trouble trying to create query, using DBIx::Class, where 2 different values may exist in one column.
When I run the following query from SQL Server, all works well;
SELECT * FROM People WHERE Name like '%Franklin%' and Name like '%Linsey%'
However, I tried writing a script with DBIx::Class, with the following:
@results = $schema->resultset( 'Peoplel' )->search({ Name => { like => '%Franklin%' }, Name => { like => '%Linsey'%' } } );
The problem here is the the column name is a hash key, so the second hash key
overwrites the value of the first hash key.
Is there a way to produce the results I want based on the SQL statement above?
Thanks.
-Phil-
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Querying 2 Values Form 1 Column in DBIx::Class
by poj (Abbot) on Jan 26, 2018 at 19:29 UTC | |
by phildeman (Scribe) on Jan 26, 2018 at 21:23 UTC | |
Re: Querying 2 Values Form 1 Column in DBIx::Class
by Your Mother (Archbishop) on Jan 26, 2018 at 19:31 UTC | |
by phildeman (Scribe) on Jan 26, 2018 at 21:41 UTC | |
by afoken (Chancellor) on Jan 27, 2018 at 19:56 UTC | |
by erix (Prior) on Jan 28, 2018 at 00:27 UTC |
Back to
Seekers of Perl Wisdom