Paul Court wrote:
>
> What does the "~*" operator mean?
>
>
> On 16 Jan 2009, at 14:52, mcsreddy wrote:
>
>> Hi, I am new to Zend. I want to construct a query from multiple
>> words with LOGIC search option (or/AND) I am trying to build the
>> query something like this $query = new table(); //table is table
>> name in database $query = ($table->select() ->from($table)); $query-
>> >where('col1~* ? ', $searchkeyword) ->orwhere('col12~* ?',
>> $searchkeyword) ->orwhere('col3~* ?', $searchkeyword) -
>> >orwhere('col14~* ?', $searchkeyword) ->orwhere('col15~* ?',
>> $searchkeyword) ->orwhere('col6~* ?', $searchkeyword) ; I want to
>> construct a query which is equivalent to
>> ----------------------------------- SELECT "tableName".* FROM
>> "scemaName"."tablename" WHERE ((col1 ~* 'b' ) OR (col2 ~* 'b') OR
>> (col3 ~* 'b') OR (col4 ~* 'b') OR (col5 ~* 'b') OR (col6 ~* 'b')) OR
>> ((col1 ~* 'c' ) OR (col2 ~* 'c') OR (col3 ~* 'c') OR (col4 ~* 'c')
>> OR (col5 ~* 'c') OR (col6 ~* 'c') ) AND ((col1 ~* 'd' ) OR (col2 ~*
>> 'd') OR (col3 ~* 'd') OR (col4 ~* 'd') OR (col5 ~* 'd') OR (col6 ~*
>> 'd')) OR ((col1 ~* 'e' ) OR (col2 ~* 'e') OR (col3 ~* 'e') OR (col4
>> ~* 'e') OR (col5 ~* 'e') OR (col6 ~* 'e')) ;
>> ---------------------------------- Can anybody suggest me how to
>> generate the above mentioned query
>> View this message in context: Query construct - Multiple Word Logic
>> search
>> Sent from the Zend DB mailing list archive at Nabble.com.
>
>
>
--
View this message in context: http://www.nabble.com/Query-construct---Multiple-Word-Logic-search-tp21501126p21547470.html
Sent from the Zend DB mailing list archive at Nabble.com.
没有评论:
发表评论