access查询不重复
我想查询显示整个表的数据。但是条件是其中一列不重复的显示出来。
例如:a b c
1 2 3
1 2 4
1 3 5
结果我想显示
a b c
1 2 3
1 3 5
也就是b列不重复
up
SQL code:
select
*
from
tb t
where
c=(select min(c) from tb where a=t.a and b=t.b)
SQL code:
----------------------------------------------------------------
-- Author :fredrickhu(我是小F,向高手学习)
-- Date :2009-12-22 15:08:10
-- Version:
-- Microsoft SQL Server 2005 - 9.00.4035.00 (Intel X86)
-- Nov 24 2008 13:01:59
-- Copyright (c) 1988-2005 Microsoft Corporation
-- Developer Edition on Windows NT 5.2 (Build 3790: Service Pack 1)
--
----------------------------------------------------------------
--> 测试数据:[tb]
if object_id('[tb]') is not null drop table [tb]
go
create table [tb]([a] int,[b] int,[c] int)
insert [tb]
select 1,2,3 union all
select 1,2,4 union all
select 1,3,5
--------------开始查询--------------------------
select
*
from
tb t
where
c=(select min(c) from tb where a=t.a and b=t.b)
---------------
相关问答:
麻烦各位帮忙看看啊
代码如下:
CoInitialize(NULL);
_ConnectionPtr pConn(__uuidof(Connection));
_RecordsetPtr pRst(__uuidof(Recordset));
pConn->ConnectionString="Provider ......
delphi 2007 + access 2007 +odbc +TADODataset,TADOConnection,TADOCommand
//删除数据
procedure TCDSSelectTools.DeleteMachine(byMachineID: string);
tmpCmd := TADOCommand.Create(ni ......
CREATE TABLE Product(model integer,
maker varchar(20),
CONSTRAINT SAND PRIMARY KEY (model),
CONSTRAINT PANDA FOREIGN KEY (model) REFERENCES PC (model)
ON DELETE CASCADE ......
access中的text型的数字,怎么比较大小啊?
大家知道吗?
因为我想根据这一列数据的大小查询一些东西
举个例子:
就是,我有一列数据为编码:
是text型的数字:如
1101
1102
1103
等,
我现在要取出编码比 ......
我机子里面没有ACCESS,请问在不重装系统的情况下该如何把它装上,之前我试装过其它版本的SP3 OFFICE,但还是装不上,
请问有什么好办法吗?
安装OFFICE ,选择安装ACCESS就可以呀 。
引用
安装OFFICE ,选择安装 ......