select - MySQL set the result of a query = to a column binary -


i want create new variable/column in dataset signifies presence or lack there of data mining query.

i thought be:

select * @variable1  dataset  contents rlike '[[:<:]]foo[[:>:]]'  or contents rlike '[[:<:]]example[[:>:]]' 

however error:

operand should contain 1 column(s).

i think somehow need select binary (not *), not sure how this.

you need 2 things in order accomplish this.

first, must alter dataset have column result:

alter table dataset add contents_flag tinyint(1) not null default 0. 

now, need update new dataset column results of query:

update dataset set contents_flag = 1  contents rlike '[[:<:]]foo[[:>:]]'  or contents rlike '[[:<:]]example[[:>:]]' 

Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -