´ÓSQLÊý¾Ý¿âÀïËæ»ú¶ÁÈ¡Ò»Ìõ¼Ç¼
ÔõÑù´ÓÊý¾Ý¿âÀïËæ»ú¶ÁÈ¡
Ò»Ìõ¼Ç¼£¬
SELECT TOP 1 * from dbo.Customers ORDER BY NEWID()
ÕâÑù£¬Èç¹ûÊÇËæ»ú10
Ìõ£¬100Ìõ¡£¡£¡£¡£
SELECT TOP 10 * from dbo.Customers ORDER BY NEWID()
ºÜ¼òµ¥°É¡£
²»¹ýtopºóÃæÊý×ÖÔ½´ó£¬ÔËÐÐËÙ¶ÈÔ½Âý¡£²»ÍƼöÊý¾Ý×ÖÌ«´ó¡£
ÒÔºó´úÂëÔÚSQL20005ÖвâÊÔͨ¹ý£¬ACCESSºÃÏñ²»ÐС£
Ïà¹ØÎĵµ£º
ʹÓÃÁËÒ»¶Îʱ¼äºó£¬SQL Server µÄ LDFÎļþÌå»ý¾Þ´ó.
ÈçºÎ´¦ÀíàÏ, ¶ÔÓÚ SQL Server 2005 ¼°Ö®Ç°µÄ°æ±¾£¬¿ÉÒÔʹÓÃÈçÏ SQL£º
declare @name varchar(50)
set @name='dbname
'
backup
log @name
with truncate_only
dbcc shrinkdatabase (@name,20)
¿ÉÊÇÔÚ SQL Server 2008 ¿ªÊ¼£¬Ö´ÐÐÉÏÃæµÄÓï¾ä»á±¨´í:
'truncate ......
±¾ÎÄÕÂÔ´´ÓÚwww.yafeilinux.com תÔØÇë×¢Ã÷³ö´¦¡£
½Ó×ÅÉÏһƪ½Ì³Ì¡£
¶þ£¬ÔÚSQLÓï¾äÖÐʹÓñäÁ¿¡£
ÎÒÃÇÏÈ¿´ÏÂÃæµÄÒ»¸öÀý×Ó£¬½«“²éѯ”°´Å¥µÄ²Ûº¯Êý¸ü¸ÄÈçÏ£º
void Widget::on_pushButton_clicked()
{
QSqlQuery query;
query.prepare(“insert i ......
USE StudentInfo
--=====================================================
--Author £ºyangjuncheng
--Create Date:2010.5.26
--Decription :¸ø±íÌí¼ÓÔ¼Êø£¨¿ÉÒÔÔÚ´´½¨±íʾֱ½ÓÌí¼Ó
-- Ò²¿ÉÒÔʹÓÃalter¹Ø¼ ......
sql server 2005 ¼òµ¥ÔËÓú¯Êý
1.null º¯Êý
Ó÷¨ÓëoracleÖÐnvl()ÀàËÆ£¬´¦Àíº¯ÊýΪisnull()£¬
ÀýÈ磺
select ename,sal+isnull(comm,0)
from emp
go
isnull(comm,0)µÄÓ÷¨ÊÇ£º commΪnull Ôò·µ»Ø0 ·ñÔòΪ commµÄÖµ¡£
2.V ......