sqlÖÐwhere1=1ʲôÒâ˼
where 1=1 ÊÇ sql ÅÌÎÊÖÐÒ»ÖÖռλ·û£¬ÌåÏÖʼÖÕΪÕæ¡£ËüÓÃÓÚÈ·±£ÅÌÎÊʼÖÕ·µ»ØÊý¾Ý£¬¼ò»¯ÅÌÎÊ£¬²¢±ÜÃâÒòȱÉÙ where ×Ó¾ä¶ø·ºÆðµÄ¹ýʧ¡£
SQL ÖÐ WHERE 1=1 µÄ¼ÄÒå
ÔÚ SQL ÅÌÎÊÓï¾äÖУ¬WHERE ×Ó¾äÓÃÓÚ¹ýÂËÊý¾Ý£¬½ö·µ»ØÖª×ãÖ¸¶¨Ìõ¼þµÄÐС£WHERE 1=1 ͨ³£ÓÃ×÷Ò»¸öռλ·û£¬ÌåÏÖʼÖÕΪÕæµÄÌõ¼þ¡£
ΪʲôʹÓà WHERE 1=1
WHERE 1=1 ¾³£ÓÃÓÚÒÔÏÂÄ¿µÄ£º
×÷Ϊռλ·û£ºËü°ü¹ÜÅÌÎÊʼÖÕ·µ»ØһЩÐУ¬×ÝȻûÓÐÆäËû¹ýÂËÌõ¼þÒ²ÊÇÔÆÔÆ¡£
¼ò»¯ÅÌÎÊ£ºËü¼ò»¯ÁËÐèÒª°üÀ¨¶à¸öÌõ¼þµÄÅÌÎÊ£¬ÓÉÓÚÎÞÐè¼ì²éÿ¸öÌõ¼þÊÇ·ñΪÕæ¡£
±ÜÃâ¹ýʧ£ºËüÓÐÖúÓÚ±ÜÃâÓÉÓÚȱÉÙ WHERE ×Ó¾ä¶øµ¼ÖÂÒâÍâ»ñÈ¡ËùÓÐÐеĹýʧ¡£
ÏêϸʾÀý
ÏÂÃæÊÇÒ»¸öʹÓà WHERE 1=1 ×÷Ϊռλ·ûµÄʾÀýÅÌÎÊ£º
SELECT * FROM customers WHERE 1=1 AND age > 25;
µÇ¼ºó¸´ÖÆ
´ËÅÌÎʻ᷵»ØËùÓÐÄêËê´óÓÚ 25 ËêÇÒÖª×ãÆäËûÌõ¼þ£¨ÈôÊDZ£´æµÄ»°£©µÄ¿Í»§¡£
ÆäËû×¢ÖØÊÂÏî
WHERE 1=1 ËäÈ»ÊÇÒ»¸öÀû±ãµÄռλ·û£¬µ«ËüÒ²¿ÉÄܽµµÍÅÌÎÊÐÔÄÜ£¬ÓÉÓÚËüÆÈʹÊý¾Ý¿âɨÃè±íÖеÄËùÓÐÐС£
ÔÚÐèҪʱ£¬×îºÃʹÓøüÏêϸµÄ¹ýÂËÌõ¼þ£¬ÒÔÌá¸ßÅÌÎÊЧÂÊ¡£
WHERE 1=1 ²»Ó¦Óë WHERE 1=0 »ìÏý£¬ºóÕß½«Ê¼ÖÕ·µ»Ø 0 ÐС£
ÒÔÉϾÍÊÇsqlÖÐwhere1=1ʲôÒâ˼µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡