Domanda

SELEZIONA o.id, o.id come oid, o.id come orderId, o.cid, o.date, o.state,            o.price, o.currency, o.lastChange, o.url AS permalink, o.period,            o.bloggerId, o.bloggerShare, o.offerValidity, o.rebate, o.cid,            o.reason, o.bidReason, o.bidDate, o.bidPeriod, o.rate,            o.lastChange2, o.permalinkDate, o.cancelDate, o.bidValidDate,            o.acceptDate, o.approveDate, o.archived, o.bloggerPrice,            o.customerPrice, o.cancelReason, o.listPrice, o.adFormat,            o.lastPayDate, o.startDate, o.endDate, o.customerBidDate,            o.zoneId, c.campaignStartDate, c.campaignEndDate,            c.type come campaignType, c.test, c.test1, c.special, c.packageId,            c.fixPrice, c.type, c.priceBidding, c.textCreation, o.hiddenField,            o.startDate, p.url as producturlold, p.pressurl, p.companyurl,            p.blogurl, p.mediaurl, p.short,            p. descrizione come descrizione del prodotto, p. descrizione 2, p. immagine,            c.teaser, c.kind, c.title, mc.country come campaignCountry,            c.minlen, c.productPrice, c.currency as campaignCurrency,            c.productTitle, c.url, c.producturl, c.pressurl, c.companyurl,            c.blogurl, c.mediaurl, c.escription, c.image, c.teaser,            c.productReturn, c.testProduct, c.mid as customerId, c.adText,            c.fixAdText, c.requiresBlog, c.bidStop, c.accountingPeriod,            c.actionCodeType, c.actionCodesDescription, ac.code,            ac2.code come massCode, b.title come blogtitle, b.url come bloggerurl,            b.pis come pis, b.uniqueVisitor come uvs, b.pisCounter come pisCounter,            b.uvsCounter come uvsCounter, b.aPI come aPI, b.aUV come aUV,            b.id come blogId, p.title come productTitleOld,            b.lastChange come blogLastChange, b.trRank, r1.rate come orderRate,            r2.Rate come memberRate, b.reviews     DA tariffe r1, tariffe r2, ordini o     left join blog b on (o.blogId = b.id)     codici join sinistro ac on (ac.orderId = o.id), campagna c     left join product p on (c.productId = p.id)     codici join sinistro ac2 su (ac2.campaignId = c.id e                              c.actionCodeType = 2),      persona mc     dove o.cid = c.id     e mc.mid = c.mid     e o.id = '223704'     e o.state < > 0     e r1.currency = o.currency     e r2.currency = 'EUR'     e r1.date = FROM_UNIXTIME (o.date, '% Y-% m-% d')     e r2.date = r1.date

Voglio testare se memberRate e orderRate è Null, dovrebbe continuare come posso farlo? Qualche idea?

È stato utile?

Soluzione

Contrastalo alla fine dovrebbe fare il trucco:

--Within the WHERE clause  
AND r2.Rate IS NOT NULL 
AND r1.Rate IS NOT NULL

Altri suggerimenti

Non sono sicuro di aver capito cosa stai chiedendo, ma aggiungi and memberRate is not null and orderRate is not null alla fine della tua query e salterai tutti i risultati in cui uno di questi due campi è nullo.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top