Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All
I want to know,How to Write Join Query When there is no Common Fields in Two Tables Without using Union

What I have tried:

SELECT Count(*)
From IGN1 T0 Inner Join OBTN on T0. No common colm =T1. No common colm

WHERE T0.ItemCode Like 'ZP%'
Posted
Updated 12-Sep-16 21:44pm

1 solution

I'd suggest to read this: Visual Representation of SQL Joins[^]

When there's no common column, the only way to join tables is to use cross join, but (!) that join produces lots of records, because produces the Cartesian product of the tables involved in the join.

For further details about cross join, please see: Using Cross Joins[^]
 
Share this answer
 
v2
Comments
Member 12605293 13-Sep-16 4:23am    
Hi Maciej
Thanks for your quick reply It is helpful,Is there any there way to join this apart from using Cross Join.
Maciej Los 13-Sep-16 4:31am    
You're very welcome.
As far as i know there's no other way to join tables where is no common field.
If my answer was helpful, please accept it (green button) - formally, to remove your question from unanswered list.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900