Click here to Skip to main content
15,899,679 members
Home / Discussions / Database
   

Database

 
AnswerRe: Query About NULL Pin
Dave Mavin2-Mar-06 1:52
Dave Mavin2-Mar-06 1:52 
QuestionTo pass parameters in Data Access Application Block.. Pin
MudkiSekhon2-Mar-06 1:02
MudkiSekhon2-Mar-06 1:02 
QuestionTier Development : DataSets Pin
Dave Mavin1-Mar-06 23:52
Dave Mavin1-Mar-06 23:52 
AnswerRe: Tier Development : DataSets Pin
cbhkenshin_home2-Mar-06 8:06
cbhkenshin_home2-Mar-06 8:06 
GeneralRe: Tier Development : DataSets Pin
Dave Mavin3-Mar-06 0:21
Dave Mavin3-Mar-06 0:21 
GeneralRe: Tier Development : DataSets Pin
Dave Mavin3-Mar-06 3:51
Dave Mavin3-Mar-06 3:51 
QuestionJoin SELECT statements? Pin
myNameIsRon1-Mar-06 20:41
myNameIsRon1-Mar-06 20:41 
AnswerRe: Join SELECT statements? Pin
Colin Angus Mackay1-Mar-06 21:04
Colin Angus Mackay1-Mar-06 21:04 
myNameIsRon wrote:
Can you have more than one SELECT statement to add more columns to your output? Or am I going about it wrong?


Yes, but from your example I cannot see what you are trying to do.

If this does not work, could you provide some sample data and show how you'd like it all joined up.

SELECT Products.ItemNumber, SizesAndCategories.SizeCatName AS Size, Categories.Category
FROM Products
INNER JOIN SizeAndCategories ON Products.SizeID=SizesAndCategories.SizeCatID
INNER JOIN (SELECT SizesAndCategories.SizeCatName AS Category
            FROM Products
            INNER JOIN SizeAndCategories ON Products.CategoryID=SizesAndCategories.SizeCatID 
            WHERE Products.ItemId = @ItemId) AS Categories
WHERE Products.ItemId = @ItemId


By the way, you can probably tell I prefer the explicit use of the JOIN type (e.g. INNER JOIN) to make it very obvious on what conditions two tables are joined together. I happen to think it makes the code easier to understand.

ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?

-- modified at 3:04 Thursday 2nd March, 2006

GeneralRe: Join SELECT statements? Pin
myNameIsRon3-Mar-06 5:33
myNameIsRon3-Mar-06 5:33 
QuestionCreate index using ADO.NET??? Pin
wasife1-Mar-06 17:16
wasife1-Mar-06 17:16 
AnswerRe: Create index using ADO.NET??? Pin
Colin Angus Mackay1-Mar-06 20:43
Colin Angus Mackay1-Mar-06 20:43 
GeneralRe: Create index using ADO.NET??? Pin
Paul Conrad2-Mar-06 5:35
professionalPaul Conrad2-Mar-06 5:35 
QuestionSQL Profiler results question Pin
theJazzyBrain28-Feb-06 23:19
theJazzyBrain28-Feb-06 23:19 
QuestionArithmetic overflow error converting expression to data type int. Pin
japel28-Feb-06 13:39
japel28-Feb-06 13:39 
AnswerRe: Arithmetic overflow error converting expression to data type int. Pin
WoutL1-Mar-06 0:37
WoutL1-Mar-06 0:37 
GeneralRe: Arithmetic overflow error converting expression to data type int. Pin
Le centriste1-Mar-06 1:53
Le centriste1-Mar-06 1:53 
AnswerRe: Arithmetic overflow error converting expression to data type int. Pin
japel1-Mar-06 12:39
japel1-Mar-06 12:39 
Questionnewbie SQL question Pin
Mundo Cani28-Feb-06 10:57
Mundo Cani28-Feb-06 10:57 
AnswerRe: newbie SQL question Pin
Al Ortega28-Feb-06 11:14
Al Ortega28-Feb-06 11:14 
AnswerRe: newbie SQL question Pin
Colin Angus Mackay1-Mar-06 1:25
Colin Angus Mackay1-Mar-06 1:25 
GeneralRe: newbie SQL question Pin
Paul Conrad1-Mar-06 16:44
professionalPaul Conrad1-Mar-06 16:44 
QuestionExamples of creating multirecord databound controls for *WinForms* Pin
Rabb Moshe Plotkin28-Feb-06 5:33
Rabb Moshe Plotkin28-Feb-06 5:33 
QuestionFIFO financial analysis proc - any ideas? Pin
Duncan Edwards Jones28-Feb-06 2:27
professionalDuncan Edwards Jones28-Feb-06 2:27 
AnswerRe: FIFO financial analysis proc - any ideas? Pin
Chris Meech28-Feb-06 3:11
Chris Meech28-Feb-06 3:11 
QuestionErrors connecting to database Pin
Deffiant27-Feb-06 22:40
Deffiant27-Feb-06 22:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.