Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Èí¼þ²âÊÔÖг£ÓõÄSQLÓï¾ä

²éѯÓï¾ä
Óï·¨¸ñʽ£º
SELECT
    [ALL | DISTINCT | DISTINCTROW ]
      [HIGH_PRIORITY]
      [STRAIGHT_JOIN]
      [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_
      [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUN
    select_expr [, select_expr ...]
    [from table_references
    [WHERE where_condition]
    [GROUP BY {col_name | expr | position}
      [ASC | DESC], ... [WITH ROLLUP]]
    [HAVING where_condition]
    [ORDER BY {col_name | expr | position}
      [ASC | DESC], ...]
    [LIMIT {[offset,] row_count | row_count OFF
    [PROCEDURE procedure_name(argument_list)]
    [INTO OUTFILE 'file_name' export_options
      | INTO DUMPFILE 'file_name'
      | INTO var_name [, var_name]]
[FOR UPDATE | LOCK IN SHARE MODE]]
³£ÓþÙÀý
--²éѯmember±íÖÐËùÓеĻáÔ±¼Ç¼
SELECT * from member;
ÆäÖГ*”ºÅ±íʾÏÔʾ·ûºÏÌõ¼þµÄ¼Ç¼µÄËùÓÐ×Ö¶Î
ÔÚÊý¾Ý¿âÖд洢ÀàÐÍΪÎı¾µÄ×ֶβéѯ
--²éѯmember±íÖÐÐÕÃû½ÐÕÅÈýµÄ»áÔ±
SELECT * from member WHERE name = 'ÕÅÈý';
--²éѯmember±íÖÐËùÓÐÐÕÕŵĻáÔ±
SELECT * from member WHERE name like ‘ÕÅ%’;
ÆäÖГ%”±íʾÈÎÒâ×Ö·û¶¼·ûºÏÌõ¼þ¡£¼´Ö»ÓÐÂú×ãÐÕÃûÖеÚ1¸ö×Ö·ûÊÇ“ÕÅ”¾ÍÂú×ã²éѯÌõ¼þ
--²éѯmember±íÖÐËùÓÐÃû×Ö°üº¬“Èý”µÄ»áÔ±
SELECT * from member WHERE name like ‘%Èý%’;
ÓÉÓÚ“Èý”×Öǰºó¶¼º¬Óаٷֺœ%”£¬Õâ¾Í±íʾ“Èý”×ÖÇ°ÃæºÍ“Èý”×ÖºóÃæ²»¹ÜÊÇÈκÎ×Ö·û¶¼Âú×ã²éѯÌõ¼þ£¬¼´Ê¹“Èý”×ÖǰºóûÓÐ×Ö·ûÒ²·ûºÏÌõ¼þ
ÔÚÊý¾Ý¿âÖÐÄêÁä´æ´¢ÎªÊý×ÖÀàÐ͵Ä×ֶβéѯ
--²éѯmember±íÖÐÄêÁäµÈÓÚ18µÄ»áÔ±
SELECT * from member WHERE age = 18;
--²éѯmember±íÖÐÄêÁä´óÓÚµÈÓÚ18µÄ»áÔ±
SELECT * from member WHERE age >= 18;


Ïà¹ØÎĵµ£º

Æ´½Ó×Ö·û´®sqlÓï¾ä²éѯ[WEBѧϰʵÀý]

ÎÊÌâÀ´×Ôhttp://topic.csdn.net/u/20091128/10/6750afae-71df-42df-ae23-14024736e1d8.html?64174
ÒÀÎҲ²â¿ÉÄÜÊÇҪƴ×Ö¶ÎÃû³Æ
if (D > 0)
{
UpData_D = "D_D" + D.ToString();
DataSet myData = Socut.Data.ExecuteDataSet("UPDATE YUAN SET " + UpData_D + "='" + Y + "',..........
}
......

ÂÛ̳Àï¿´µ½µÄÒ»¸öSQLÎÊÌâ¼°½â´ð

ÎÊÌ⣺
ÓÐÒ»¸ö·ÖÊý±í
id classid,score
1  01    120
2  01    128
3  02    98
4  04    134
5  04    78
ÏÖÔÚҪͳ¼Æ ¸÷°àscore >120,ºÍ´óÓÚ90·ÖµÄÈËÊý
´ïµ½ÈçÏÂЧ¹û
classid >120 >90
01  &nb ......

SQL begin end ¿é×÷ÓÃ

PL/SQL´æ´¢¹ý³Ì±à³Ì ÊÕ²Ø
  /**author huangchaobiao
*Email:huangchaobiao111@163.com
*/
PL/SQL´æ´¢¹ý³Ì±à³Ì(ÉÏ)
1. OracleÓ¦Óñ༭·½·¨¸ÅÀÀ
´ð£º1) Pro*C/C++/... : CÓïÑÔºÍÊý¾Ý¿â´ò½»µÀµÄ·½·¨£¬±ÈOCI¸ü³£ÓÃ;
2) ODBC
3) OCI: CÓïÑÔºÍÊý¾Ý¿â´ò½»µÀµÄ·½·¨£¬ºÍProCºÜÏàËÆ£¬¸üµ×²ã£¬ºÜÉÙÓÃ;
4) SQLJ ......

sqlµ¼³öÊý¾Ý¿âʱ±¨ "µÇ½ xxx ʧ°Ü",ÎÞ·¨Íê³É

ÐÞ¸ÄÊý¾Ý¿â¶ÔÏóËùÓÐÈË
½ñÌì°ïÅóÓÑ´«Êý¾Ý¿â±¨´í,Ìáʾ "
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]µÇ½ xxx ʧ°Ü",ÕýºÃǰ¶Îʱ¼äÅöµ½Í¬ÑùÎÊÌâ,³¢ÊÔɾ³ýÓû§ xxx , ÓÖ±¨´í,Ìáʾ" Óû§ÓµÓжÔÏó,ËùÒÔÎÞ·¨É¾³ý". ²é¿´Êý¾Ý¿â,·¢ÏÖ¸ÃÓû§ÓµÓÐºÜ¶à´æ´¢¹ý³Ì,Ò»¸öÒ»¸ö¸ÄÌ«Âé·³,´ÓÍøÉÏÕÒµ½ÈçÏ·½·¨,Ç¡ºÃ½â¾ö´ËÎÊÌâ:
CR ......

ÈÃÈË·¢¿ñµÄsqlÓï¾ä£¡

StringBuilder Asql = new StringBuilder();
            Asql.Append(" select '' as 'ÐòºÅ', T_Station.µµ°¸ºÅ,T_Station.StationName as '̨վÃû' , ");
            Asql.Append("  ÇøÕ¾ºÅ.ÇøÕ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ