oracle添加字段sql sql如何查询包含某一字段的值?
sql如何查询包含某一字段的值?
不同的数据库,SQL语句略有区别:1.如果是Access数据库,SQL语句应为:SELECT * FROM TableName WHERE A LIKE "*2011*"2.如果是Oracle数据库,SQL语句应为:SELECT * FROM TableName WHERE A LIKE " 11%"3.如果是SQL SERVER数据库,SQL语句应为:SELECT * FROM TableName WHERE A LIKE " 11%"
sql如何查询包含某一字段的值?
最简单的子查询:select * from table where date = (select max(date) from table) 或者用轮子哥讲的join自己: select * from table t1 left join (select max(date) as date from table) t2 on t1.date=t2.date where t2.date is not null
用SQL怎样查询到包含有某个字段的所有表名?
select a.name 表名,b.name 列名 from sysobjects a,syscolumns b where a.id = b.id and b.name = "表名"and a.type="U"
还有一种:
SELECT b.name as TableName,a.name as columnname
From syscolumns a INNER JOIN sysobjects b
ON a.id=b.id
AND b.type=’U’
AND a.name=’你的字段名字’
oracle添加字段sql sql同一字段既满足a又满足b sql查询某字段是否包含字母
版权声明:本文内容由互联网用户自发贡献,本站不承担相关法律责任.如有侵权/违法内容,本站将立刻删除。