Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
brindlogcool
Creator III
Creator III

same column name

Hi,

In the SQL Query with Join (Not at the Qlikview join) if there are two column names then Qlikview is throwing an error as ODBC failed. Even the alaising is not working, Is there any solution for the same...

5 Replies
Not applicable

Can you provide some more details?

Are you using a query within the SQL part of the load script?

If so, do the queries work on the server? Do they load independently?

What error message are you getting?

Thanks,

Chris

brindlogcool
Creator III
Creator III
Author

Yes the Query is working fine in  SQL Developer. When we use in the Qlikview if i remove the duplicate column name then it is working fine else it is throwing the oledb read failed error.

Not applicable

So the script looks something like the below?


Test:

LOAD Field1,

    Field2,

    Field3;

SQL SELECT

               Field1,

               Field2,

               Field3

FROM TestDB.dbo.TestTable1;

Test2:

LOAD Field3,

    Field4,

    Field5;

SQL SELECT

               Field3,

               Field4,

               Field5

FROM TestDB.dbo.TestTable2;

brindlogcool
Creator III
Creator III
Author

SQL SELECT

               TestDB.dbo.TestTable1.Field1

               TestDB.dbo.TestTable2.Field1,

               TestDB.dbo.TestTable1.Field2,

               TestDB.dbo.TestTable1.Field3

FROM TestDB.dbo.TestTable1 A,TestDB.dbo.TestTable2 B

Where A. Field1=B. Field1

I am doing the Join Query in the sql and trying to display column which is with the same from the table.

Not applicable

My SQL isn't brilliant but shouldn't the query run as below? Having two fields with the same name in the query will mean QV can't discern between the two...

SQL SELECT

               A.Field1

               B.Field1 [Compare1],

               A.Field2,

               A.Field3

FROM TestDB.dbo.TestTable1 A

               join

               TestDB.dbo.TestTable2 B

Where A. Field1=B. Field1