inner join

arkiboys 9,686 Reputation points
2024-04-22T10:17:32.0866667+00:00

hello,

there is a value in one of the columns.

for example:

table1.column1 --> 11506.8

in another table2.column2, there is a value for example:

column2 --> 11506.80

In the inner join transaformation, as per business I have to do an inner join to join table1.column1 == table2.column2

But there is no match

any suggestions?

thank you

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,196 questions
{count} votes

Accepted answer
  1. Smaran Thoomu 12,620 Reputation points Microsoft Vendor
    2024-04-22T11:52:17.6733333+00:00

    Hi @arkiboys

    Thank you for reaching out to the community forum with your query.

    Based on your query, it seems like there is a mismatch between the values in table1.column1 and table2.column2 when performing an inner join. One possible reason for this could be the difference in the data types of the columns. For example, table1.column1 might be of type float while table2.column2 might be of type decimal. In such cases, the values might appear to be the same, but the data types are different, causing the inner join to fail.

    To resolve this issue, you can try converting the data types of the columns to match each other before performing the inner join. For example, you can try converting table1.column1 to decimal using the CAST function and then perform the inner join. Here's an example query:

    SELECT *
    FROM table1
    INNER JOIN table2
    ON CAST(table1.column1 AS decimal(10,2)) = table2.column2
    

    This query converts table1.column1 to a decimal data type with a precision of 10 and a scale of 2 before performing the inner join. You can adjust the precision and scale values based on your specific requirements.

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful