Hi @Muhammad Anzar ,
Welcome to the Microsoft TSQL Q&A Forum!
The query editor displays a red line under the table column and table name because a basic syntax error is recognized.
ErlandSommarskog has already explained the problem of incomplete join clauses. In addition, you should accidentally put the first select statement together because the first select statement is not even a complete statement.
By the way, I suggest you use table aliases.The use of table alias please refers to the following statement:
SELECT c.CompanyName AS Expr1, d.OrderID,
d.ProductName, d.Discount, d.Total,
d.UnitPrice,d.DiscountAmount,
d.SaleQuantity, o.OrderDate, o.DisCounter,
o.GrandTotal,t.*
FROM dbo.Orders o
INNER JOIN dbo.[Order Details] d ON o.OrderID = d.OrderID
INNER JOIN dbo.Customers c ON o.CustomerID = c.CustomerID
CROSS JOIN dbo.Company_Title t.Order_Detail=d.Order_Detail
Since I don’t know the details of the table (columns and data), the link condition behind the cross join is my guess
t.Order_Detail=d.Order_Detail
If you have any question, please feel free to let me know.
If the response is helpful, please click "Accept Answer" and upvote it.
Regards
Echo
If the answer is helpful, please click "Accept Answer" and upvote it.
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.