I am working to implement a data connection between my C# application and a SQL Server Express database. Please bear in mind I have not worked with SQL queries before.
I have the following relevant tables:
ArticlesCommon
ArticlesLocalized
CategoryCommon
CategoryLocalized
The ArticlesCommon
table 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?
Edit:
Another question though. Both ArticlesLocalized and ArticlesCommon contain ID, which naturally are the same. I want to select everything from ArticlesCommon but everything except ID from ArticlesLocalized.. Is there a concise way to achieve this?
I guess that
SELECT * FROM .....
yield all columns from all joined tables?