社区
MS-SQL Server
帖子详情
select * from a,b where hh.a=hh.b;这个有错吗?
lipeng_cq
2005-09-20 04:36:29
a和b表都有关健字hh(户号)
但系统却报错?
...全文
314
23
打赏
收藏
select * from a,b where hh.a=hh.b;这个有错吗?
a和b表都有关健字hh(户号) 但系统却报错?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
23 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
chichunhua
2005-09-21
打赏
举报
回复
不说了..............
zzxiaoma
2005-09-21
打赏
举报
回复
select * from a,b where a.hh=b.hh
luckydog_l
2005-09-21
打赏
举报
回复
应该是a.hh,b.hh
云中客
2005-09-21
打赏
举报
回复
select * from a,b where a.hh=b.hh
这个语句的问题在于你关联了两个表,而显示时用*来代替,系统并不知道要代替哪一个表,所以要写清楚
可以这样写:
select a.* ,b.* from a,b where a.hh=b.hh
singlepine
2005-09-21
打赏
举报
回复
select * from a,b where hh.a=hh.b;
--------------------
应该是
select * from a,b where a.hh=b.hh;
也就说是
select * from 表a,表b where 表a的字段hh=表b的字段hh;--表名在前面,字段跟在表名加.的后面
MorningTea
2005-09-21
打赏
举报
回复
楼主lipeng_cq发贴后没有再跟贴:-)
lisiyong
2005-09-21
打赏
举报
回复
select * from a,b where a.hh=b.hh
or
select * from a,b where b.hh=a.hh
or
select * from a inner join b on a.hh=b.hh
是正解啊
怎么楼主不说话..........
8254034
2005-09-20
打赏
举报
回复
select * from a,b where a.hh=b.hh
zhangyang555
2005-09-20
打赏
举报
回复
up to jackluo1981(无知者无畏)
jackluo1981
2005-09-20
打赏
举报
回复
I guess the sponsor must be fool us!
$扫地僧$
2005-09-20
打赏
举报
回复
嗨。。。。。。。。。
iwl
2005-09-20
打赏
举报
回复
select * from a,b where a.hh=b.hh
常遇道
2005-09-20
打赏
举报
回复
select * from table1 a,tabl2 b where a.hh=b.hh
real_name
2005-09-20
打赏
举报
回复
select * from a,b where a.hh=b.hh
or
select * from a,b where b.hh=a.hh
or
select * from a inner join b on a.hh=b.hh
e1000Gb
2005-09-20
打赏
举报
回复
hh.a=hh.b----》a.hh=b.hh
rokky
2005-09-20
打赏
举报
回复
select * from a,b where a.hh=b.hh
or
select * from a,b where b.hh=a.hh
or
select * from a inner join b on a.hh=b.hh
都是正解。
feitianbianfu16
2005-09-20
打赏
举报
回复
你的hh.a=hh.b表示是hh表中的a字段和b字段,而a.hh=b.hh表示是a表中的hh字段和b表中的hh字段!
Frewin
2005-09-20
打赏
举报
回复
select * from a inner join b on a.hh=b.hh
churchatp1
2005-09-20
打赏
举报
回复
select * from a,b where a.hh=b.hh
or
select * from a,b where b.hh=a.hh
MorningTea
2005-09-20
打赏
举报
回复
select a.* ,b.* from a,b where a.hh=b.hh;
或者表别名
select Table1.* ,Table2.* from a Table1,b Table2 where Table1.hh=Table2.hh;
如果字段名不同,那么就不用加上表名标示,你要用就更好
例如:
select a.* ,b.* from a,b where h1=h2;
select a.* ,b.* from a,b where a.h1=b.h2;
加载更多回复(3)
org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [
SELECT
* FROM
1、sql拼写中的错误: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [
SELECT
* FROM DEMO_ORDER WHERE 1=1and order_id = '1']; nested exception is com.mysql.jdbc.exceptions.
SQL简单查询语句,语法
** 简单查询语法,语句 **
select
* from where order by --先from 后 where 后
select
最后 order by
select
sbrlsh 病人流水号,szycs AS 住院次数 from where --单独查表中这两列并且起别名,AS就是起别名,空格也可以
select
gz+200 月工资加补助200,gz*12 年工资,gz/30 日工
where exists (
select
1 from 中null=null时遇到的实际问题
数据 --------------------------------(数据A中FLDCPH是没有数据的就是空) ID FLDCPH STARTTIME A 2015-11-06 15:42:52 B OXA 2015-11-05 11:26
oracle查询时间区间段数据
一. 查询给定时间在开始时间列与结束时间列范围中数据;
select
* from t 表名 where t.日期列 >= to_date('20xx-xx-xx 00:00:00','yyyy-mm-dd
hh
24:mi:ss') and t.日期列 <= to_date('20xx-xx-xx 23:59:59','yyyy-mm-dd
hh
24:mi:ss') 二. 查询...
mysql
select
1 from dual_pl-sql中
select
* from dual 这个dual是什么
展开全部Dual简单的说就是一个空表,Oracle提供的最小62616964757a686964616fe59b9ee7ad9431333366303131的工作表,只有一行一列,具有某些特殊功用。常用来通过
select
语句计算常数表达式。特性:1、Oracle提供的最小的表,不论进行何种操作(不要删除记录),它都只有一条记录——'X'。例如:执行
select
* from dual,里面只有一条...
MS-SQL Server
34,594
社区成员
254,589
社区内容
发帖
与我相关
我的任务
MS-SQL Server
MS-SQL Server相关内容讨论专区
复制链接
扫一扫
分享
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章