尝试运行SQL查询以显示针对EAN的标识符值。
如果EAN不存在,我如何为Identifier返回NULL值?所以我查询列表,我必须先看看EAN是否存在并返回标识符。如果不存在以获取NULL记录
查询位于
之下select Identifier,EAN from StarProduct
WHERE EAN ='98132361069'
OR EAN ='98132361069'
OR EAN ='98132361052'
OR EAN ='3605540854600'
OR EAN ='3605540853764'
OR EAN ='716170075020'
OR EAN ='716170075013'
OR EAN ='716170060699'
OR EAN ='716170060682'
OR EAN ='716170060651'
OR EAN ='716170060613'
OR EAN ='716170060606'
OR EAN ='716170060590'
OR EAN ='716170060583'
OR EAN ='716170060576'
OR EAN ='716170060569'
OR EAN ='716170060552'
OR EAN ='3348901219549'
OR EAN ='3348901219532'
OR EAN ='3348901219525'
OR EAN ='3348901219518'
OR EAN ='3348901219501'
OR EAN ='3348901219495'
OR EAN ='3348901219488'
OR EAN ='3348901219471'
OR EAN ='3348901219464'
OR EAN ='3348901219457'
OR EAN ='3348901219440'
OR EAN ='3348901219426'
OR EAN ='3348901190572'
OR EAN ='3348901190565'
OR EAN ='3348901190558'
OR EAN ='3348901103435'
OR EAN ='3348900574915'
OR EAN ='3380814020010'
OR EAN ='20714404628'
OR EAN ='20714324636'
OR EAN ='3395015360018'
OR EAN ='3395015360025'
OR EAN ='3395015360001'
OR EAN ='85805033552'
OR EAN ='85805142728'
OR EAN ='85805142698'
OR EAN ='3605522108011'
OR EAN ='3605522023482'
OR EAN ='3605522023420'
OR EAN ='3605522023369'
OR EAN ='3605522023307'
OR EAN ='3605522023246'
OR EAN ='3360372026136'
OR EAN ='3605521752710'
OR EAN ='3605521403971'
OR EAN ='3605521403919'
OR EAN ='3360372026143'
OR EAN ='3605521907844'
OR EAN ='3605521907783'
OR EAN ='3605521907721'
OR EAN ='3605521907660'
OR EAN ='3605521849953'
OR EAN ='3605521849717'
OR EAN ='3605521849656'
OR EAN ='3605521849533'
OR EAN ='3605521849472'
OR EAN ='3605521849410'
OR EAN ='236378525818'
OR EAN ='3605533273807'
OR EAN ='3605533273623'
OR EAN ='3605533273388'
OR EAN ='3605532697253'
OR EAN ='3600520932903'
OR EAN ='3600520772042'
OR EAN ='773602181766'
OR EAN ='773602168484'
OR EAN ='773602168422'
OR EAN ='773602168408'
OR EAN ='773602168385'
OR EAN ='773602168446'
OR EAN ='773602168507'
OR EAN ='773602168491'
OR EAN ='773602181759'
OR EAN ='773602264452'
OR EAN ='773602340767'
OR EAN ='773602340750'
OR EAN ='773602340743'
OR EAN ='773602340736'
OR EAN ='773602335671'
OR EAN ='773602311576'
OR EAN ='773602310920'
OR EAN ='773602298037'
OR EAN ='773602298020'
OR EAN ='773602298013'
OR EAN ='773602298006'
OR EAN ='773602297993'
OR EAN ='773602297986'
OR EAN ='773602297979'
OR EAN ='773602297962'
OR EAN ='773602297955'
OR EAN ='773602297948'
OR EAN ='773602297931'
OR EAN ='773602297924'
OR EAN ='773602297917'
OR EAN ='773602297900'
OR EAN ='773602297894'
OR EAN ='773602297887'
OR EAN ='773602220007'
OR EAN ='773602219995'
OR EAN ='773602219971'
OR EAN ='7330051126064'
OR EAN ='7330051126040'
OR EAN ='7330051126033'
OR EAN ='7330051126026'
OR EAN ='7330051126057'
OR EAN ='7330051126071'
OR EAN ='4084500159297'
OR EAN ='4084500159068'
OR EAN ='4084500158757'
OR EAN ='4084500158603'
OR EAN ='4084500158559'
OR EAN ='4973167960110'
OR EAN ='4973167969717'
OR EAN ='4973167902820'
OR EAN ='4973167902813'
OR EAN ='4973167902806'
OR EAN ='4973167902790'
OR EAN ='730852112056'
OR EAN ='730852112032'
OR EAN ='730852112001'
OR EAN ='730852110083'
OR EAN ='730852111967'
OR EAN ='730852111936'
OR EAN ='730852111905'
OR EAN ='3365440158078'
OR EAN ='3365440775411'
OR EAN ='3365440676152'
OR EAN ='3365440676091'
OR EAN ='3365440676039'
OR EAN ='3365440675971'
OR EAN ='3365440675919'
OR EAN ='3365440675797'
OR EAN ='3365440675735'
OR EAN ='3365440675674'
OR EAN ='3365440675612'
OR EAN ='3365440675490'
OR EAN ='3365440675254'
OR EAN ='85805172770'
OR EAN ='85805172787'
OR EAN ='85805172817'
OR EAN ='85805172831'
OR EAN ='85805172886'
OR EAN ='85805172893'
OR EAN ='85805172916'
OR EAN ='98132375356'
OR EAN ='98132391578'
OR EAN ='3380814066018'
OR EAN ='3380814065813'
OR EAN ='3380814065714'
OR EAN ='3380814065615'
OR EAN ='3380814065516'
OR EAN ='3380814065318'
OR EAN ='3380814066216'
OR EAN ='3380814071111'
OR EAN ='3380814071913'
OR EAN ='3380814071814'
OR EAN ='3380814071616'
OR EAN ='3380814071715'
OR EAN ='3380814071517'
OR EAN ='3380814071418'
OR EAN ='3380814071319'
OR EAN ='3380814071210'
OR EAN ='3380814072217'
OR EAN ='20714711856'
OR EAN ='20714711894'
OR EAN ='20714711900'
OR EAN ='20714711924'
OR EAN ='20714711979'
OR EAN ='3348901238038'
OR EAN ='3348901248075'
OR EAN ='3348901250849'
OR EAN ='3348901248099'
OR EAN ='3348901248112'
OR EAN ='3348901248105'
OR EAN ='3348901248334'
OR EAN ='3348901248358'
OR EAN ='3348901248365'
OR EAN ='3348901248228'
OR EAN ='3348901248235'
OR EAN ='3348901248259'
OR EAN ='27131564027'
OR EAN ='27131564010'
OR EAN ='27131533023'
OR EAN ='27131514213'
OR EAN ='27131513308'
OR EAN ='27131513292'
OR EAN ='27131513285'
OR EAN ='27131513261'
OR EAN ='27131513254'
OR EAN ='27131187066'
OR EAN ='3401561313061'
OR EAN ='7317851142180'
OR EAN ='7317851142166'
OR EAN ='7317851142128'
OR EAN ='7317851142203'
OR EAN ='7317851142104'
OR EAN ='7317851142142'
OR EAN ='236344958640'
OR EAN ='236344958633'
OR EAN ='236344958626'
OR EAN ='236344958619'
OR EAN ='236344958558'
OR EAN ='7611773150019'
OR EAN ='7611773150002'
OR EAN ='7611773150026'
OR EAN ='7611773150071'
OR EAN ='7611773150064'
OR EAN ='7611773150057'
OR EAN ='7611773150040'
OR EAN ='7611773150033'
OR EAN ='7611773186599'
OR EAN ='7611773186643'
OR EAN ='7611773186636'
OR EAN ='7611773186629'
OR EAN ='7611773186612'
OR EAN ='7611773186605'
OR EAN ='4935421601856'
OR EAN ='4935421601924'
OR EAN ='4935421601900'
OR EAN ='4935421601894'
OR EAN ='4935421601870'
OR EAN ='4935421601931'
OR EAN ='6412600842531'
OR EAN ='6412600842630'
OR EAN ='6412600842647'
OR EAN ='6412600842623'
OR EAN ='6412600842616'
OR EAN ='3600531117085'
OR EAN ='3600531117108'
OR EAN ='3600531117092'
OR EAN ='3600531117061'
OR EAN ='3600530898367'
OR EAN ='3600530968176'
OR EAN ='3600530968169'
OR EAN ='3600530968183'
OR EAN ='717334068087'
OR EAN ='607710002418'
OR EAN ='607710002425'
OR EAN ='607710002463'
OR EAN ='607710034808'
OR EAN ='607710034785'
OR EAN ='607710034815'
OR EAN ='607710039186'
OR EAN ='607710039179'
OR EAN ='607710039162'
OR EAN ='607710039155'
OR EAN ='607710039148'
OR EAN ='607710039131'
OR EAN ='607710039124'
OR EAN ='607710039117'
OR EAN ='607710039100'
OR EAN ='607710039094'
答案 0 :(得分:2)
要返回NULL
值,您可以使用left join
。一种典型的方法是:
select sp.Identifier, n.EAN
from (select '98132361069' as EAN union all
. . .
) n left join
StarProduct sp
on sp.EAN = n.EAN;
如果EAN
的列表已经来自查询,则更容易将该查询包含在n
而不是列表中。