查詢(xún)某個(gè)數據庫中的所有表 :
select * from sysobjects where xtype='u';
查詢(xún)某個(gè)表的表結構:
select col.[name] as '字段名',
col.[length] as '長(cháng)度',
type.[name] as '類(lèi)型',
pro.value as '描述'
from syscolumns as col
left join Systypes as type on col.xtype=type.xtype
left join SysProperties as pro on col.id=pro.id and col.colid=pro.smallid
where col.id=(select id from Sysobjects where name='要查詢(xún)的表名');
隨機選擇記錄:
select newid();
隨機讀取若干條記錄:[ ------>n表示要取出的數據行數]
sqlserver------>: select top n * from 表名 order by newid();
mysql--------->: select * from 表名 order by rand() limit n;
本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請
點(diǎn)擊舉報。