从mysql获取记录,不包括值

时间:2019-07-10 12:40:08

标签: php mysql

$result = mysql_query("SELECT email FROM m2n3r_djcf_items WHERE exp_days=29 AND published=1 AND id>8000 AND email LIKE '%@%'");

需要添加下一个参数: 在m2n3r_djcf_items中,我们有“促销”,我们可以在那里 狗,猫,牛或狗,猫或牛等。

我需要获取“促销”中没有“猫”的所有记录

1 个答案:

答案 0 :(得分:1)

假设async function InsertOne(params) { return Database.tx('Insert-New-Device', async t => { let system = null, disks = null, cpus = null; const query = pgp.helpers.insert(params.data.device, Collections.insert) + " RETURNING *"; let device = await t.one(query); // if a system is present, insert with diviceId and return if(params.data.system) { params.data.system.deviceid = device.deviceid; system = await t.systems.InsertOne(params); } // same as system if(params.data.disks) { params.data.disks.deviceid = device.deviceid; disks = await t.disks.InsertOne(params); } // same as system if(params.data.cpus) { params.data.cpus.deviceid = device.deviceid; cpus = await t.cpus.InsertOne(params); } return {device, system, disks, cpus}; }) .catch(ex => { console.log(ex); // it is better use "pg-monitor", or handle events globally throw ex; }); } 列为字符串,并且从主题SQL Query Where Field DOES NOT Contain $x开始,您可以使用以下SQL查询:

promotions

但是,正如您在该主题中所读到的那样,这可能会使查询变慢。