本文介绍了输出与内部联接查询不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的查询如下



从[transact]中选择*。[transaction_item]其中transactee_id ='1111290'



displayid transaction_id transaction_item_ transaction_item product_grade_id unit_id

TXN-1111290 8 2 28 NULL 3

TXN-1111290 13 2 26 NULL 3

TXN-1111290 15 2 28 NULL 3





i低于内部查询如下



locati transaction_idfarmerscode slipdate transaction_item_type product_grade_id



1001 8 1111290 2018-01-06 2 28 NULL

1001 8 1111290 2018- 01-06 2 28 NULL

1001 8 1111290 2018-01-06 2 28 NULL

3031 13 1111290 2018-01-06 2 26 NULL

3031 13 1111290 2018-01-06 2 26空

3031 13 1111290 2018-01-06 2 26空白

1001 15 1111290 2018-06 -27 2 28 NULL

1001 15 1111290 2018-06-27 2 28 NULL

1001 15 1111290 2018-06-27 2 28 NULL



当我运行它时显示9条记录。但是在

My query as follows

select * from [transact].[transaction_item] where transactee_id = '1111290'

displayid transaction_id transaction_item_ transaction_item product_grade_id unit_id
TXN-111129082 28 NULL 3
TXN-1111290132 26 NULL 3
TXN-1111290152 28 NULL 3


i have below inner query as follows

locati transaction_idfarmerscode slipdate transaction_item_typeproduct_grade_id

10018 11112902018-01-06 2 28NULL
10018 11112902018-01-062 28NULL
10018 11112902018-01-06 2 28NULL
303113 11112902018-01-06 2 26NULL
303113 11112902018-01-06 2 26NULL
303113 11112902018-01-06 2 26NULL
100115 11112902018-06-27 2 28NULL
100115 11112902018-06-27 2 28NULL
100115 11112902018-06-27 2 28NULL

when i run the it shows the 9 records. but in the

[transact].[transaction_item]
table 3 records for the transactee_id  '1111290'

but when i run the above inner join query for the id 1111290 the result i get 9 records. what is the mistake in my above inner join query.

please let me know.

What I have tried:

My query as follows

 select * from [transact].[transaction_item] where transactee_id = '1111290'

displayid transaction_id transaction_item_ transaction_item product_grade_id unit_id
TXN-1111290	8		2	     28	             NULL	       3
TXN-1111290	13		2	     26              NULL	       3
TXN-1111290	15		2	     28	             NULL	       3


i have below inner query as follows

locati transaction_idfarmerscode slipdate transaction_item_type	product_grade_id

1001	8	  1111290	2018-01-06 	2	         28	NULL
1001	8	 1111290	2018-01-06	2	         28	NULL
1001	8	 1111290	2018-01-06 	2	         28	NULL
3031	13	 1111290	2018-01-06 	2	         26	NULL
3031	13	 1111290	2018-01-06 	2	         26	NULL
3031	13	 1111290	2018-01-06 	2	         26	NULL
1001	15	 1111290	2018-06-27 	2	         28	NULL
1001	15	 1111290	2018-06-27 	2	         28	NULL
1001	15	 1111290	2018-06-27 	2	         28	NULL

when i run the it shows the 9 records. but in the <pre>[transact].[transaction_item]
table 3 records for the transactee_id  '1111290'

but when i run the above inner join query for the id 1111290 the result i get 9 records. what is the mistake in my above inner join query.

please let me know.

推荐答案


这篇关于输出与内部联接查询不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-21 12:13