当前位置:首页 » 编程语言 » sql20000
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

sql20000

发布时间: 2022-07-23 01:29:01

sql查询两张表字段不同,关联后筛选账号金额大于20000的数据

--你的意思是表1和表2账号相同但是卡号不同是吧?
select名称,账号,卡号,sum(金额),日期from表2groupby名称,账号,卡号,日期havingsum(金额)>20000

Ⅱ sqlserver2008数据库中,我想设置varchar字段的长度为20000,要怎么做

楼主 你都知道了最长是8000 肯定不能这样改了
如果要使用这样的长度 就用下面的类型
nvarchar(max)
varchar(max)
varbinary(max)
脚本如下 把表名和列名换下就可以了
alter table 表名 alter column 列名 nvarchar(max) not null
如果解决了楼主的问题 希望采纳

Ⅲ sql server 20000怎么把一个以年月日为字段的一列 分别转成年 月 日 时间 4列。

select year(addtime) as nian,month(addtime) as yue,day(addtime) as ri,convert(char(8),addtime,108) as shijian from table

Ⅳ 一个sql查询5000条很快,查询到20000多条时特别慢

数量太大。sql是用于访问和处理数据库的标准的计算机语言。查询5000条为正常水平,超过10000条系统就会难以成立造成卡顿变慢。

Ⅳ 用SQL server 20000 数据库 查询数据库做题

--创建数据库 create database ProctSales on primary --建立主数据文件 ( name = 'ProctSales', --逻辑文件名 filename='e:\data\ProctSales.mdf', --物理文件路径和名字 size=10Mb, --初始大小 maxsize=100Mb, --最大尺寸为10m filegrowth=10% --增长速度为10% ) log on ( name = 'ProctSales_log', --建立日志文件 filename='e:\data\ProctSales_log.ldf',--物理文件路径和名字 size=2Mb, --初始大小 maxsize=unlimited, --最大尺寸为无限大 filegrowth=1Mb--增长速度为1mb ); --创建产品表 create table Proct ( ProctID varchar(64) not null, ProctName varchar(50) null, Price numeric(10,2) null, Stocks int null, constraint PK_DAY_BASICSITE primary key nonclustered (ProctID) ); --创建客户表 create table Customer ( CustomerID varchar(64) not null, CustomerName varchar(200) null, Region varchar(100) null, Charger varchar(20) null, Tel int null constraint PK_DAY_BASICSITE primary key nonclustered (CustomerID) ); --产品销售表 create table Sales ( id varchar(64) not null, ProctID varchar(64) not null, CustomerID varchar(64) not null, Amount int null, Money numeric(10,2) null constraint PK_DAY_BASICSITE primary key nonclustered (id) ); --设置外键关联 alter table Sales add constraint FK_BASIC_CO_CONTACT_C_BASIC_CU foreign key (ProctID) references Proct (ProctID); alter table Sales add constraint FK_BASIC_CO_CONTACT_C_BASIC_CU foreign key (CustomerID) references Customer (CustomerID); 一般在实际开发过程中,为了减少麻烦,字段类型基本都可设置为varchar

Ⅵ 几道简单的SQL 2000查询分析器语句题目

7.select distinct e.age,e.sx,e.atitle,e.salary,e.addr
from employee as e,employee as em
where e.addr=em.addr
8.select *
from employee
where max(salary)
9.select sales.order_no
from sales
where sales.tot_amt>(select tot_amt
from sales
where sale_id=E0013 and order_date =1996/10/05)(我不知道你用什么软件编写的,时间类不好定义)
11.create view C_SH(cust_id,cust_name,customer.addr)
AS Select cust_id,cust_name,customer.addr
from customer
where customer.addr="上海"
(先发这几个,有点事,回来继续写)