sqlservse求出表里a的字段1,和另一个表b的字段1求出他俩一共有多少相同的

3172℃ 谢剑锋

SQL高手来看,下A表的某一字段包含B表的一个字段

addr like '%'+b,addr from a,b where aselect tel

sqlservse求出表里a的字段1,和另一个表b的字段1求出他俩一共有多少相同的

sql查询 一个表的字段名是另一个表字段值 怎么查

要根据另一个表,说明这2个表需要join起来!select a.*from ajoin b on b.aid = a.id -- 关联起来order by b.xx -- 据另一个表的某字段

sql 将一个表中的字段与另一个表中的字段进行检索.

select a.id from A where id in (select id from B)

SQL语句把同一个表中的a字段中的数据复制到另一个字段b中

用update 更新update cust set s8_16 = unit ,unit = null

SQL同在一个表的一字段等一另一字段的语句怎么写

declare @t table ( id int, a int, b nchar(5) )insert @tselect 1, 123, 'x' unionselect 2, 456, 'x' unionselect 3, 789, 'x' unionselect 4, 333, 'x'select * from @tupdate t1 set t1.b = t2.a from @t as t1 inner join @t as t2 on t1.id = t2.id;select * from @t;

sql数据库,从一张表A里取出一个字段,并和本表A另一个字段进行对应?

select to_date(a,'yyyy-mm-dd') a ,sum(分组数值类型字段) from 表group by to_date(a,'yyyy-mm-dd')

sql查询时从一个表的两个字段替换为另一个表的一个字段

select t2.mc,t3.mc from x t1,y t2,y t3 where t1.a=t2.id and t1.b=t3.id这样试试,注意各个表的别名

请问sql server中 a数据库中的A表里的1字段如何更新到b数据库中A表了的1字段

update b.dbo.A set 字段1 = x.字段1 from a.dbo.A as x where x.字段 = b.dbo.A.字段 b.dbo.A 表示数据库b下面dbo用户下的A表

SQL数据库,请问如何查询一个表两个字段内容和另一个表两个字段内容完全相同的记录?

需要用连接查询来处理.如有以下2张表:查询2张表id和name字段内容完全相同的内容,可用如下语句:select a.* from test a,test1 b where a.id=b.id and a.name=b.name;结果:说明,两表连接where条件要写上关联条件,因为提问是两个字段完全相等,所以就写作:a.id=b.id and a.name=b.name

SQL语句,已知A表的第1个字段的值,怎么用A表的第2字段去B表查询

使用如下语句即可:select case when a_1 = '1' then 'b' when a_1 = '2' then 's' else a_1 end as a_1 from a;

TAG: 求出 MySQL