Hi @Jayesh Dave
If the final Output does not include the Table_Name and Column_Name column, then you could use CROSS JOIN (Cartesian Product).
Check this:
SELECT *
FROM (SELECT DISTINCT Customer_ID FROM Table_Schema_Info) S CROSS JOIN Cust_Tab
Output:
If you need both Table_Name and Column_Name columns appear in the final output, then you could use ROW_NUMBER() to create unique RNum column for both tables, and then JOIN with these two RNum columns. Like this:
SELECT B.Customer_ID,A.TicketID,A.FirstName,A.LastName,A.DATEOPENED,B.Table_Name,B.Column_Name
FROM (SELECT *,ROW_NUMBER()OVER(ORDER BY TicketID)AS RNum_A FROM Cust_Tab) A
FULL JOIN
(SELECT *,ROW_NUMBER()OVER(PARTITION BY Customer_ID ORDER BY Column_Name)AS RNum_B FROM Table_Schema_Info)B
ON A.RNum_A=B.RNum_B
Output:
Best regards,
LiHong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.