Sql query - how to construct
- by Max Malmgren
Hi. I am working to implement a dataconnection between my C# application and an Sql Express database. Please bear in mind I have not worked with Sql queries before.
I have the following relevant tables:
ArticlesCommon
ArticlesLocalized
CategoryCommon
CategoryLocalized
where ArticlesCommon holds language independent information such as price, weight etc.
This is the statement for now:
SELECT * FROM ArticlesCommon INNER JOIN ArticlesLocalized ON
ArticlesCommon.ID = ArticlesLocalized.ID
WHERE ArticlesLocalized.Language = @language
ORDER BY ArticlesCommon.DateAdded
ArticlesCommon contains a category id for each row. Now, I want to use this to look up the localized information in CategoryLocalized and add it to the result, something like
SELECT *, CategoryLocalized.Name as CategoryName.
If I have gotten my point across, is this doable?
Thank you.