NYCPHP Meetup

NYPHP.org

[nycphp-talk] MySQL query question

Matt Juszczak matt at atopia.net
Wed Nov 17 15:08:48 EST 2004


Oh oops, nevermind :)

On Tue, 16 Nov 2004, Ophir Prusak wrote:

> This should work (if you want full substring search).
>
> select count(*) from table where company like concat('%',last_name,'%')
>
> On Tue, 16 Nov 2004 11:08:18 -0500, DeWitt, Michael
> <mjdewitt at alexcommgrp.com> wrote:
>> Does anyone know if there is a way to write a query in a v3 engine to do a
>> query comparing two columns using like?
>>
>> I would like to count all rows where the last name appears in the company
>> name.
>>
>> In sql server a query like this works:
>>
>> select count(*) from table where company like rtrim(last_name)+'%'
>>
>> Thanks in advance.
>>
>> Mike
>>
>> _______________________________________________
>> New York PHP Talk
>> Supporting AMP Technology (Apache/MySQL/PHP)
>> http://lists.nyphp.org/mailman/listinfo/talk
>> http://www.newyorkphp.org
>>
> _______________________________________________
> New York PHP Talk
> Supporting AMP Technology (Apache/MySQL/PHP)
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.newyorkphp.org
>
>
> !DSPAM:419a322c609941025134037!
>



More information about the talk mailing list