SQL 4
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SQL 4相关的知识,希望对你有一定的参考价值。
鏍囩锛?/p>
SQL WHERE 瀛愬彞
WHERE 瀛愬彞鐢ㄤ簬杩囨护璁板綍銆?/span>
SQL WHERE 瀛愬彞
WHERE 瀛愬彞鐢ㄤ簬鎻愬彇閭d簺婊¤冻鎸囧畾鏍囧噯鐨勮褰曘€?/p>
SQL WHERE 璇硶
SELECT column_name,column_name
FROM table_name
WHERE column_name operator value;
婕旂ず鏁版嵁搴?/h2>
鍦ㄦ湰鏁欑▼涓紝鎴戜滑灏嗕娇鐢?RUNOOB 鏍锋湰鏁版嵁搴撱€?/p>
涓嬮潰鏄€夎嚜 "Websites" 琛ㄧ殑鏁版嵁锛?/p>
+----+--------------+---------------------------+-------+---------+ | id | name | url | alexa | country | +----+--------------+---------------------------+-------+---------+ | 1 | Google | https://www.google.cm/ | 1 | USA | | 2 | 娣樺疂 | https://www.taobao.com/ | 13 | CN | | 3 | 鑿滈笩鏁欑▼ | http://www.runoob.com/ | 4689 | CN | | 4 | 寰崥 | http://weibo.com/ | 20 | CN | | 5 | Facebook | https://www.facebook.com/ | 3 | USA | +----+--------------+---------------------------+-------+---------+
WHERE 瀛愬彞瀹炰緥
涓嬮潰鐨?SQL 璇彞浠?"Websites" 琛ㄤ腑閫夊彇鍥藉涓?"CN" 鐨勬墍鏈夌綉绔欙細
SELECT * FROM Websites WHERE country=鈥楥N鈥?
鎵ц杈撳嚭缁撴灉锛?/p>
鏂囨湰瀛楁 vs. 鏁板€煎瓧娈?/h2>
SQL 浣跨敤鍗曞紩鍙锋潵鐜粫鏂囨湰鍊硷紙澶ч儴鍒嗘暟鎹簱绯荤粺涔熸帴鍙楀弻寮曞彿锛夈€?/p>
鍦ㄤ笂涓疄渚嬩腑 鈥楥N鈥?鏂囨湰瀛楁浣跨敤浜嗗崟寮曞彿銆?/p>
濡傛灉鏄暟鍊煎瓧娈碉紝璇蜂笉瑕佷娇鐢ㄥ紩鍙枫€?/p>
SELECT * FROM Websites WHERE id<>1;
鎵ц杈撳嚭缁撴灉锛?/p>
WHERE 瀛愬彞涓殑杩愮畻绗?/h2>
涓嬮潰鐨勮繍绠楃鍙互鍦?WHERE 瀛愬彞涓娇鐢細
杩愮畻绗?/th> | 鎻忚堪 |
---|---|
= | 绛変簬 |
<> | 涓嶇瓑浜庛€?strong>娉ㄩ噴锛?/strong>鍦?SQL 鐨勪竴浜涚増鏈腑锛岃鎿嶄綔绗﹀彲琚啓鎴?!= |
> | 澶т簬 |
< | 灏忎簬 |
>= | 澶т簬绛変簬 |
<= | 灏忎簬绛変簬 |
BETWEEN | 鍦ㄦ煇涓寖鍥村唴 |
LIKE | 鎼滅储鏌愮妯″紡 |
IN | 鎸囧畾閽堝鏌愪釜鍒楃殑澶氫釜鍙兘鍊?/td> |
以上是关于SQL 4的主要内容,如果未能解决你的问题,请参考以下文章
sql 日期转换代码片段 - Dato,120,konvertere