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

SQL DISTINCTµÄÓ÷¨

SELECT Ö¸ÁîÈÃÎÒÃÇÄܹ»¶ÁÈ¡±í¸ñÖÐÒ»¸ö»òÊý¸öÀ¸Î»µÄËùÓÐ×ÊÁÏ¡£ Õ⽫°ÑËùÓеÄ×ÊÁ϶¼×¥³ö£¬ÎÞÂÛ×ÊÁÏÖµÓÐÎÞÖظ´¡£ÔÚ×ÊÁÏ´¦ÀíÖУ¬ÎÒÃǻᾭ³£Åöµ½ÐèÒªÕÒ³ö±í¸ñÄڵIJ»Í¬ ×ÊÁÏÖµµÄÇé¿ö¡£»»¾ä»°Ëµ£¬ÎÒÃÇÐèÒªÖªµÀÕâ¸ö±í¸ñ/À¸Î»ÄÚÓÐÄÄЩ²»Í¬µÄÖµ£¬¶øÿ¸öÖµ³öÏֵĴÎÊý²¢²»ÖØÒª¡£ÕâÒªÈçºÎ´ï³ÉÄØ£¿ÔÚ SQL ÖУ¬ÕâÊǺÜÈÝÒ××öµ½µÄ¡£ÎÒÃÇÖ»ÒªÔÚ SELECT ºó¼ÓÉÏÒ»¸ö DISTINCT ¾Í¿ÉÒÔÁË¡£DISTINCT µÄÓï·¨ÈçÏ£º
SELECT DISTINCT "À¸Î»Ãû"
from "±í¸ñÃû"
¾ÙÀýÀ´Ëµ£¬ÈôÒªÔÚÒÔϵıí¸ñ£¬Store_Information£¬ÕÒ³öËùÓв»Í¬µÄµêÃûʱ£¬
Store_Information±í¸ñ
store_name
Sales
Date
Los Angeles
$1500
Jan-05-1999
San Diego
$250
Jan-07-1999
Los Angeles
$300
Jan-08-1999
Boston
$700
Jan-08-1999
ÎÒÃǾʹòÈ룬
SELECT DISTINCT store_name from Store_Information
½á¹û:
store_name
Los Angeles
San Diego
Boston


Ïà¹ØÎĵµ£º

PL/SQLÀý×Ó

ÒÔÏÂÊǾ­²âÑéÄÜÕýÈ·ÔËÐеÄ:
create    table t_emp_log212
(
who varchar2(10) not null,
action varchar2(10) not null,
actime date
);
create or replace trigger tri_emp_insert
before insert
on t_emp
begin
insert into t_emp_log(who,action,actime)values(user,'insert',sysdate);
end ......

MS SQL SERVER±í·ÖÇøµÄÎÊÌâ

×î½ü·ÖÇøMS SQL SERVERµÄ±í·ÖÇø£¬¸Ð¾õÉõÊǸ´ÔÓ¡£ 1. Ä¿Ç°Ö»ÖªµÀMS SQL SERVERÖ§³Ö·¶Î§·ÖÇøhttp://msdn.microsoft.com/zh-cn/library/ms187802.aspx£¬ ÔÚ¹Ù·½ÍøÕ¾µÄ˵Ã÷ÎĵµÀïÃ棬ҲûÓÐ˵֧³ÖÆäËûµÄ·ÖÇø¡£ÍøÉÏÓÐÐÖµÜ˵»¹Ö§³Öhash·ÖÇø¡£²»ÖªµÀÊÇÔõôʵÏֵġ£ÒòΪʹÓ÷ÖÇøº¯Êý£¬ÎÒÖ»ÖªµÀÄÜŪ³ö·¶Î§·ÖÇø¡£Í¬OracleµÄ±í·ÖÇøÏà± ......

SQL Server 2005 ³öÏÖµ½Ö÷»ú µÄ TCP/IP Á¬½Óʧ°Ü

ÓÃjdbcÁ¬½ÓSQL Server2005³öÏÖµ½Ö÷»ú µÄ TCP/IP Á¬½Óʧ°Ü¡£ java.net.ConnectException: Connection refused: connect!
¹À¼ÆÊÇÒòΪsqlserver2005ĬÈÏÇé¿öÏÂÊǽûÓÃÁËtcp/ipÁ¬½Ó¡£
Äú¿ÉÒÔÔÚÃüÁîÐÐÊäÈ룺telnet localhost 1433½øÐмì²é£¬Õâʱ»á±¨´í£ºÕýÔÚÁ¬½Óµ½localhost...²»ÄÜ´ò¿ªµ½Ö÷»úµÄÁ¬½Ó£¬ÔÚ¶Ë¿Ú 1433: Á¬½Óʧ°Ü
Æ ......

ʵÀý·ÖÎöSQLÖгý·¨µÄÈýÖÖд·¨

Ê×ÏÈÇë¿´
http://topic.csdn.net/u/20070821/15/8a2dac05-51b8-4eb1-b41d-4fbe8a232c85.html
ÌûÖдÓʵ¼ÊÎÊÌâ³ö·¢£¬ÌÖÂÛSQLÓï¾äÖÐÈçºÎ±íʾ³ý·¨ÔËËã¡£
 
ÒÔÏÂÊÇÎÊÌâµÄ¸ø³öÓë¼òÒªÃèÊö£º
 ±íA£ºÉ̵êÐÅÏ¢
ANO, ANAME, WQTY, CITY
101, ÉØɽÊéµê, 15, ³¤É³
204, Ç°ÃÅÉ̵ê, 89, ±±¾©
256 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ