SQLSERVER 1.查询某个数据库中所有的表名: SELECT Name FROM SysObjects Where XType='U' ORDER BY Name 2.查询数据库中的所有数据库名: SELECT Name FROM Master..SysDatabases ORDER BY Name…
用sql获取数据库中所有的表名的方法:1.oracle下:select table_name from all_tables;2.MySQL下:select table_name from information_schema.tables where table_schema='csdb' and table_type='base table';3.sql server下:select name from sys.tables go…
例1:查询某个文章及其对应的评论(单个详情) ) FROM A; 例2:查询分类表中,每种分类各包含多少商品(汇总) SELECT category_id, (SELECT count(goods_id) FROM Goods WHERE category_id = A.category_id) FROM category; 部分参考:http://zhidao.baidu.com/link?url=FAZU7UHkC-qZXm4rPm5SNzHtVPf_YzINFsM-sNIeVSXungAt…