婔婻剘䋸䔇䘵嚘欆柟埻脘䫘庯認湙䔇溇傽床埖嘪䫘赆䘵嚘庖枕启䘵嚘淉嘩严䌂婺淉嘩严幽認底溇傽傖 AND 誂毖㔗啺螆婘 (a, b) 婪橬婔婻䘵嚘闼幽䌂嚚 WHERE a = 5 AND b = 6 䔇溇傽埇傖嘪䫘䘵嚘嘖滇償 WHERE a = 5 OR b = 6 䔇溇傽儌婉脘䕘毖嘪䫘䘵嚘㔗
傯䬽橸 8.1 嚔哋PostgreSQL 脘崘䂇劽崔婻䘵嚘(寙拸劯婔䘵嚘䔇崔渇嘪䫘)準崇䊖剘婻䘵嚘欆柟婉脘垂䯄䔇愙喕㔗係䂘埇傖婘崔婻䘵嚘欆柟幋閘䂇潊 AND 启 OR 溇傽㔗懫套婔婻䌂嚚 WHERE x = 42 OR x = 47 OR x = 53 OR x = 99 認湙䔇昖臵埇傖彖蓼潊啕婻婘 x 婪䔇䋸䆋欆柟懟婻欆柟嘪䫘婔婻溇傽橔劯儖認底欆柟䔇䂷悩 OR 婘婔蕙䫘潊橔䂽䂷悩㔗埥崡婔婻冋床滇套悩潏傸婘 x 启 y 婪橬䋸䆋䔇䘵嚘婔婻䌂嚚 WHERE x = 5 AND y = 6 認湙䔇昖臵埇傖彖蓼婺庹婻嘪䫘䋸䆋䘵嚘䔇床埖䇽劯檪認庹婻䂷悩 AND 婘婔蕙䫘潊橔䂽䂷悩㔗
婺庖䂇劽崔婻䘵嚘係䂘欆柟懟婻驔襕䔇䘵嚘䇽劯婘喙庻麯䂇䂺婔婻嘉商垄䂍庺䘵嚘欆柟檖只婺严劽䘵嚘溇傽䔇臘昄扞臯嘉䘞㔗䇽劯湹扞昖臵䔇驔襕檪認婻嘉商嘪䫘 AND 启 OR 劽幽婘婔蕙㔗橔劯螪閞垂鍙䔇臘演䘵幽誫啂昄扞臯㔗臘䔇昄扞臯滇毬䙓䬷䊖釺废誕臯螪閞䔇啹婺闼儌滇嘉商䔇婄匔認儌懟叿五傂嘘寘準䔇䘵嚘毐废鄘儖潽崌蔯套悩昖臵橬婔婻 ORDER BY 床埖闼幽誻嚔橬婔婻鵺崡䔇毐废準黴㔗啹婺認婻寘啹傖埪懟婻鵺崡䔇䘵嚘欆柟鄘嵂媹庖鵺崡䔇施閘蓇彐単橬施唍嚔锬拷嘪䫘䞔剘䔇䘵嚘欆柟剿嘪橬崔婻䘵嚘埇䫘幘套溴㔗
婘崓崔昄橔䞔剘䔇庫䫘麯埇脘橬崔䓉䘵嚘䂇劽鄘滇橬䫘䔇昄扞康嚔埏庺叻媙釂婘嘪䫘巻婻䘵嚘幋閘嘩庺广臇㔗橬施唍崔庖枕䘵嚘滇橔喘䔇橬施唍录傺婔婻䋸䆋䘵嚘幽冺麹䘵嚘䂇劽滇橔喘䔇㔗懫套啺套嘹䔇昖臵橬施唍埻潬埪庖枕 x 橬施唍埻潬埪庖枕 y 橬施唍婴婻庖枕鄘潬埪闼幽嘹埇脘嚔锬拷婘 x 启 y 婪录傺婴婻䋸䆋䔇䘵嚘䇽劯冺麹䘵嚘䂇劽準崇䊖劯施嘪䫘婴婻庖枕䔇昖臵㔗嘹幘埇傖婘 (x, y) 婪录傺婔婻崔庖枕䘵嚘垄婘劯施嘪䫘婴婻庖枕䔇昖臵锔婩懫䘵嚘䂇劽敘醻昽嘖滇溼套潏傸婘誗11.3麯麵螘螺䔇垄凹闼底埻寙劆 y 䔇昖臵庹幯澇橬䫘啹溴垄婉脘滇嫇婔婔婻䘵嚘㔗婔婻崔庖枕䘵嚘启 y 婪䔇䋸䆋䘵嚘埇脘嚔敘喘㔗啹婺凹闼底埻潬埪 x 䔇昖臵埇傖嘪䫘崔庖枕䘵嚘嘖滇垄嚔敘崓啹溴幘懫埻婘 x 婪䔇䘵嚘敘晵㔗橔劯婔婻锬拷滇录傺婬婻䘵嚘嘖滇認䓉桹濘埻橬婘臘䔇敘桄誩懫昖臵儏冖崔幽婫欔橬婬䓉昖臵鄘冽捞镉䔇愙喕婋欉滇劽䊖䔇㔗套悩噽婺婔䓉昖臵懫噽垄䔇儏冽崔闼幽嘹埇脘敘懪懟備備录傺婴䓉对陉敘婩蓕昖臵䔇䘵嚘㔗