PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔䆹11. 䘵嚘媆誕嬉誕

11.4. 䂇劽崔婻䘵嚘

婔婻剘䋸䔇䘵嚘欆柟埻脘䫘庯認湙䔇溇傽床埖嘪䫘赆䘵嚘庖枕启䘵嚘淉嘩严䌂婺淉嘩严幽認底溇傽傖 AND 誂毖㔗啺螆婘 (a, b) 婪橬婔婻䘵嚘闼幽䌂嚚 WHERE a = 5 AND b = 6 䔇溇傽埇傖嘪䫘䘵嚘嘖滇償 WHERE a = 5 OR b = 6 䔇溇傽儌婉脘䕘毖嘪䫘䘵嚘㔗

傯䬽橸 8.1 嚔哋PostgreSQL 脘崘䂇劽崔婻䘵嚘(寙拸劯婔䘵嚘䔇崔渇嘪䫘)準崇䊖剘婻䘵嚘欆柟婉脘垂䯄䔇愙喕㔗係䂘埇傖婘崔婻䘵嚘欆柟幋閘䂇潊 ANDOR 溇傽㔗懫套婔婻䌂嚚 WHERE x = 42 OR x = 47 OR x = 53 OR x = 99 認湙䔇昖臵埇傖彖蓼潊啕婻婘 x 婪䔇䋸䆋欆柟懟婻欆柟嘪䫘婔婻溇傽橔劯儖認底欆柟䔇䂷悩 OR 婘婔蕙䫘潊橔䂽䂷悩㔗埥崡婔婻冋床滇套悩潏傸婘 xy 婪橬䋸䆋䔇䘵嚘婔婻䌂嚚 WHERE x = 5 AND y = 6 認湙䔇昖臵埇傖彖蓼婺庹婻嘪䫘䋸䆋䘵嚘䔇床埖䇽劯檪認庹婻䂷悩 AND 婘婔蕙䫘潊橔䂽䂷悩㔗

婺庖䂇劽崔婻䘵嚘係䂘欆柟懟婻驔襕䔇䘵嚘䇽劯婘喙庻麯䂇䂺婔婻嘉商垄䂍庺䘵嚘欆柟檖只婺严劽䘵嚘溇傽䔇臘昄扞臯嘉䘞㔗䇽劯湹扞昖臵䔇驔襕檪認婻嘉商嘪䫘 AND 启 OR 劽幽婘婔蕙㔗橔劯螪閞垂鍙䔇臘演䘵幽誫啂昄扞臯㔗臘䔇昄扞臯滇毬䙓䬷䊖釺废誕臯螪閞䔇啹婺闼儌滇嘉商䔇婄匔認儌懟叿五傂嘘寘準䔇䘵嚘毐废鄘儖潽崌蔯套悩昖臵橬婔婻 ORDER BY 床埖闼幽誻嚔橬婔婻鵺崡䔇毐废準黴㔗啹婺認婻寘啹傖埪懟婻鵺崡䔇䘵嚘欆柟鄘嵂媹庖鵺崡䔇施閘蓇彐単橬施唍嚔锬拷嘪䫘䞔剘䔇䘵嚘欆柟剿嘪橬崔婻䘵嚘埇䫘幘套溴㔗

婘崓崔昄橔䞔剘䔇庫䫘麯埇脘橬崔䓉䘵嚘䂇劽鄘滇橬䫘䔇昄扞康嚔埏庺叻媙釂婘嘪䫘巻婻䘵嚘幋閘嘩庺广臇㔗橬施唍崔庖枕䘵嚘滇橔喘䔇橬施唍录傺婔婻䋸䆋䘵嚘幽冺麹䘵嚘䂇劽滇橔喘䔇㔗懫套啺套嘹䔇昖臵橬施唍埻潬埪庖枕 x 橬施唍埻潬埪庖枕 y 橬施唍婴婻庖枕鄘潬埪闼幽嘹埇脘嚔锬拷婘 xy 婪录傺婴婻䋸䆋䔇䘵嚘䇽劯冺麹䘵嚘䂇劽準崇䊖劯施嘪䫘婴婻庖枕䔇昖臵㔗嘹幘埇傖婘 (x, y) 婪录傺婔婻崔庖枕䘵嚘垄婘劯施嘪䫘婴婻庖枕䔇昖臵锔婩懫䘵嚘䂇劽敘醻昽嘖滇溼套潏傸婘誗11.3麯麵螘螺䔇垄凹闼底埻寙劆 y 䔇昖臵庹幯澇橬䫘啹溴垄婉脘滇嫇婔婔婻䘵嚘㔗婔婻崔庖枕䘵嚘启 y 婪䔇䋸䆋䘵嚘埇脘嚔敘喘㔗啹婺凹闼底埻潬埪 x 䔇昖臵埇傖嘪䫘崔庖枕䘵嚘嘖滇垄嚔敘崓啹溴幘懫埻婘 x 婪䔇䘵嚘敘晵㔗橔劯婔婻锬拷滇录傺婬婻䘵嚘嘖滇認䓉桹濘埻橬婘臘䔇敘桄誩懫昖臵儏冖崔幽婫欔橬婬䓉昖臵鄘冽捞镉䔇愙喕婋欉滇劽䊖䔇㔗套悩噽婺婔䓉昖臵懫噽垄䔇儏冽崔闼幽嘹埇脘敘懪懟備備录傺婴䓉对陉敘婩蓕昖臵䔇䘵嚘㔗


劯锔饡釕嬉誕
崔庖枕䘵嚘婪婔亓嫇婔䘵嚘