当前位置:首页 » 操作系统 » 数据库查询语句

数据库查询语句

发布时间: 2022-01-08 18:02:40

sql数据库查询语句!

select * from 6130 where 编号列 = '61000014'

这个其实是个很简单的查询。
原理是这样的
select * from 表名 where 编号列 = '61000014'

⑵ SQL 查询语句

select 工作人员,年月,max(物品数量 )from 货物 where 年月 between 2016-01 and 2016-01 and max(物品数量 )>500

⑶ sql查询语句大全

SELECT * FROM TWS2F14CCC260D71 WHERE 地类='1999资源清查有林地'

⑷ 数据库的查询语句

SELECT
Movie.*
FROM
Movie, Player
WHERE
Movie.playactor = Player.playerID
AND Player.name LIKE '%nike%'
AND Player.sex = '男'
AND YEAR(GETDATE()) - YEAR(Player.birthday) > 40

上面是SQL Server 数据库的写法 下面是 Oracle 的

SELECT
Movie.*
FROM
Movie, Player
WHERE
Movie.playactor = Player.playerID
AND Player.name LIKE '%nike%'
AND Player.sex = '男'
AND (SYSDATE - Player.birthday) / 365 > 40

⑸ sql数据库查询语句

select gongsi as 单位,bumen as 部门,xingming as 姓名,xingbie as 性别,nianling as 年龄
from pxsgs
where gongsi='上海第二公司' and bumen='上瓷部' and xingming='李雷'

select gongsi as 单位,bumen as 部门,xingming as 姓名,xingbie as 性别,nianling as 年龄
from pxsgs
where gongsi='上海第二公司' and bumen='上瓷部' and xingming='张秋林'

⑹ SQL数据库查询语句

select * from aa t
where not EXISTS (select * from aa where 卡号=t.卡号 and 时间>t.时间)

---前提:相同卡号的最晚时间只有一个,没有重复

⑺ sql 查询语句

试一下这样行不行,我这里没有sql server2000的环境,呵呵

SELECT job_log.log_id, job_log.old_job, job_log.new_job, job_log.log_time, isnull(o_job.v_id,0) AS old_v, isnull(n_job.v_id,0) AS new_v
FROM job_log LEFT OUTER JOIN job o_job
ON (job_log.old_job = o_job.t_name)
LEFT OUTER JOIN job n_job
ON (job_log.new_job = n_job.t_name)

⑻ SQL的查询语句怎么写

如果存在一张学生信息表,表名tStudent, 列名有学号NO,姓名Name,性别Sex等,你要查出姓名是张三的信息
select
*
from
tStudent
where
Name
=
'张三'
如果只想要表中几列的信息,可以将*换成指定的列名,多列中间用逗号隔开,如:
select
NO,Name,Sex
from
tStudent
where
Name
=
'张三'

⑼ SQL查询语句

1、说明:创建数据库CREATE DATABASE database-name2、说明:删除数据库drop database dbname3、说明:备份sql server--- 创建 备份数据的 deviceUSE masterEXEC sp_admpdevice 'disk', 'testBack', 'c:\mssql7backup\MyNwind_1.dat'--- 开始 备份BACKUP DATABASE pubs TO testBack4、说明:创建新表create table tabname(col1 type1 [not null] [primary key],col2 type2 [not null],..)
根据已有的表创建新表:
A:create table tab_new like tab_old (使用旧表创建新表)
B:create table tab_new as select col1,col2… from tab_old definition only5、说明:删除新表drop table tabname6、说明:增加一个列Alter table tabname add column col type
注:列增加后将不能删除。DB2中列加上后数据类型也不能改变,唯一能改变的是增加varchar类型的长度。7、说明:添加主键: Alter table tabname add primary key(col)
说明:删除主键: Alter table tabname drop primary key(col)8、说明:创建索引:create [unique] index idxname on tabname(col….)
删除索引:drop index idxname
注:索引是不可更改的,想更改必须删除重新建。9、说明:创建视图:create view viewname as select statement
删除视图:drop view viewname10、说明:几个简单的基本的sql语句
选择:select * from table1 where 范围
插入:insert into table1(field1,field2) values(value1,value2)
删除:delete from table1 where 范围
更新:update table1 set field1=value1 where 范围
查找:select * from table1 where field1 like ’%value1%’ ---like的语法很精妙,查资料!排序:select * from table1 order by field1,field2 [desc]总数:select count as totalcount from table1
求和:select sum(field1) as sumvalue from table1
平均:select avg(field1) as avgvalue from table1
最大:select max(field1) as maxvalue from table1
最小:select min(field1) as minvalue from table1

⑽ sql简单查询语句

1、首先打开数据库,建立好表。

热点内容
cmd怎么打开python 发布:2024-12-27 00:01:15 浏览:964
兼修脚本作画 发布:2024-12-26 23:55:32 浏览:218
存储卡和sd卡一样吗 发布:2024-12-26 23:50:43 浏览:445
多空线源码 发布:2024-12-26 23:48:45 浏览:322
steam有哪些免费且配置低的游戏 发布:2024-12-26 23:45:36 浏览:337
怎么配一台服务器的游戏电脑 发布:2024-12-26 23:45:35 浏览:6
无丁之地下载ftp 发布:2024-12-26 23:36:32 浏览:292
em聚类算法 发布:2024-12-26 23:22:28 浏览:669
php字符串去重 发布:2024-12-26 23:22:26 浏览:408
vb递归算法 发布:2024-12-26 23:20:52 浏览:768