How to hardcode the value while performing the joining condition
This article explains how to hardcode values without having the comparison column in another table when performing join conditions in SQL, using an example involving three tables: Customers, Orders, and Product.
Use Case
In this use case, we have the following three tables to join:
- Customers Table
- Orders Table
- Product Table
CustomerID
from the Customers table with CustomerIDOrders
from the Orders table, and OrderedProductID
from the Orders table with ProductID
from the Product table. Additionally, we want to filter the results to only include records from the UK country by hardcoding the value in the OrderedCountry
column from the Orders table.
Steps to add Hardcode Values in Joining condition
Step 1: Create a New Data Source
Refer to this help document to successfully create a new data source by connecting to your database.
Step 2: Create an Expression
Use the expression design icon present on the data source page to create an expression with the hardcoded values.
Step 3: Join the Tables
Join the tables using the expression you created for hardcoding the values.
Step 4: Save the Data Source
After completing the join, save the data source.
Step 5: Bind Widgets
You can bind suitable widgets to view the results of your data source.