Skip to content
Advertisement

Tag: join

Conditional Inner Join with two Functions

I have two functions. I need to decide whether to join with these two based on a BIT Value. Basically if BIT=0 join with function 1 else join with function 2 I tried putting an IF Clause .. but it does not seem to work. What is the proper way to do it? Answer Just add your static condition as

Combine two tables with different columns and data

How can I combine two tables with different data and set value for CompanyC to all data in Table 2 even there is no relationship of CompanyC on Table2. And the Result Table would be like: I already tried this and it is working but the problem is since CompanyC has no data on Table 2. The result will be

PIVOT with 3 tables and JOIN without number values

Hope someone can help me or point me to the right direction. I’m more of a beginner in sql language. I have 3 table users, dataTypes and usersData I only managed to use join on three tables like this: That gets all the entries for every single user like this and then repeating multiple times the same user id: However

Advertisement