October 12, 2012 at 6:49 am
hi guys basically iv got a table here with a field called aims and a field called modules. i need to run a query to show if one aim has more than one module in the table. the table looks like this.
AIM Module
321 1
234 2
321 2
456 3
567 1
234 1
so i need a query that will show me all these aims with all the modules they have. eg
AIM MODULE
321 1,2
234 1,2
456 3
567 1
please help.
October 12, 2012 at 6:53 am
mamzy.rahman (10/12/2012)
hi guys basically iv got a table here with a field called aims and a field called modules. i need to run a query to show if one aim has more than one module in the table. the table looks like this.AIM Module
321 1
234 2
321 2
456 3
567 1
234 1
so i need a query that will show me all these aims with all the modules they have. eg
AIM MODULE
321 1,2
234 1,2
456 3
567 1
please help.
Looks like homework to me. What have you tried so far?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
October 12, 2012 at 7:18 am
i havent need help please not sure how to go about it never used sql in my life
October 12, 2012 at 8:29 am
mamzy.rahman (10/12/2012)
i havent need help please not sure how to go about it never used sql in my life
But what have you tried? I have to agree this looks a lot like homework. If we give you the answer you don't learn anything.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply