Sql query - how to construct

Posted by Max Malmgren on Stack Overflow See other posts from Stack Overflow or by Max Malmgren
Published on 2010-05-25T17:58:22Z Indexed on 2010/05/25 18:01 UTC
Read the original article Hit count: 257

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about sql

Related posts about query