结合2个表没有关系 [英] combining 2 tables with no relationship

查看:71
本文介绍了结合2个表没有关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要结合两个表,我之间没有任何关系。我想检查mod(row_no,discount_number)= 0,我将用discount_amount_percentage用gross_amount和tax_amount.how来计算吗?。如果有的话是关系意味着我们可以使用连接但没有关系



// table1

row_no gross_amount tax_amount



// table2



discount_amount_percentage discount_number

i want to combine both tables and I dnt have any relation between them.i want to check if mod(row_no,discount_number)=0 and i will calculate with discount_amount_percentage with gross_amount and tax_amount.how to do this?.If there is relationship means we can use joins but there is no relationship

//table1
row_no gross_amount tax_amount

//table2

discount_amount_percentage discount_number

推荐答案

您可以在下方使用查询



You can use below query

Select * from table1 t1, table2 t2 where --....some condition here





代替*,你可以用case来获取你的结果。



at place of *, you can use "case" for getting the your result.


这篇关于结合2个表没有关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆