Click here to Skip to main content
15,902,198 members
Home / Discussions / Database
   

Database

 
QuestionOne to one Relationship problem Pin
snouto19-Jul-08 6:45
snouto19-Jul-08 6:45 
AnswerRe: One to one Relationship problem Pin
Wendelius19-Jul-08 8:39
mentorWendelius19-Jul-08 8:39 
AnswerRe: One to one Relationship problem Pin
zahedonline21-Jul-08 1:53
zahedonline21-Jul-08 1:53 
AnswerRe: One to one Relationship problem Pin
nelsonpaixao24-Jul-08 12:28
nelsonpaixao24-Jul-08 12:28 
QuestionNeed Arrange Query result into another table Header Pin
rrrriiizz19-Jul-08 1:45
rrrriiizz19-Jul-08 1:45 
AnswerRe: Need Arrange Query result into another table Header Pin
Ashfield20-Jul-08 8:06
Ashfield20-Jul-08 8:06 
GeneralRe: Need Arrange Query result into another table Header Pin
rrrriiizz20-Jul-08 22:54
rrrriiizz20-Jul-08 22:54 
AnswerRe: Need Arrange Query result into another table Header Pin
Mycroft Holmes20-Jul-08 14:47
professionalMycroft Holmes20-Jul-08 14:47 
take a look at Pivot. Use that with a dynamic sql to construct your book colums.
In this script the @List would bhe your book titles
<br />
BEGIN<br />
	Set @SQL = 'SELECT PortfolioID, Portfolio, ' + @List + char(13) <br />
	Set @SQL = @SQL + 'FROM (SELECT PortfolioID, Portfolio, A.Element, PFClass ' + char(13) <br />
	Set @SQL = @SQL + 'FROM vwPFAttribute A ' + char(13) <br />
	Set @SQL = @SQL + 'INNER JOIN PFTree T ON T.PFClassID = A.PFClassID AND T.TreeID = ' + CONVERT(VARCHAR(20),@TreeID) + char(13) <br />
	Set @SQL = @SQL + 'WHERE A.PortfolioID NOT IN (SELECT PortfolioID FROM dbo.fn_TreeExcludedPortfolios(' + CONVERT(VARCHAR(20),@TreeID) + ')))P' + char(13) <br />
<br />
	Set @SQL = @SQL + 'Pivot (Max(Element) For PFClass In ('  + @List + ')) as Pvt' + char(13) <br />
	Set @SQL = @SQL + 'Order By Portfolio'<br />
<br />
	Print @SQL<br />
END<br />
<br />


Never underestimate the power of human stupidity
RAH

GeneralRe: Need Arrange Query result into another table Header Pin
Paul Conrad20-Jul-08 14:55
professionalPaul Conrad20-Jul-08 14:55 
GeneralRe: Need Arrange Query result into another table Header Pin
Mycroft Holmes20-Jul-08 15:08
professionalMycroft Holmes20-Jul-08 15:08 
GeneralRe: Need Arrange Query result into another table Header Pin
rrrriiizz20-Jul-08 22:12
rrrriiizz20-Jul-08 22:12 
GeneralRe: Need Arrange Query result into another table Header Pin
Mycroft Holmes20-Jul-08 22:21
professionalMycroft Holmes20-Jul-08 22:21 
AnswerRe: Need Arrange Query result into another table Header Pin
zahedonline21-Jul-08 2:03
zahedonline21-Jul-08 2:03 
GeneralRe: Need Arrange Query result into another table Header Pin
rrrriiizz21-Jul-08 23:52
rrrriiizz21-Jul-08 23:52 
GeneralRe: Need Arrange Query result into another table Header Pin
zahedonline23-Jul-08 1:42
zahedonline23-Jul-08 1:42 
Questionsetup and deployment sql server 2005 database along with Setup file Pin
vishnukamath19-Jul-08 1:06
vishnukamath19-Jul-08 1:06 
AnswerRe: setup and deployment sql server 2005 database along with Setup file Pin
SimulationofSai19-Jul-08 4:30
SimulationofSai19-Jul-08 4:30 
AnswerRe: setup and deployment sql server 2005 database along with Setup file Pin
zahedonline21-Jul-08 2:07
zahedonline21-Jul-08 2:07 
QuestionHow i cast or convert Varchar column Data into Datetime Pin
Rameez Raja18-Jul-08 23:57
Rameez Raja18-Jul-08 23:57 
AnswerRe: How i cast or convert Varchar column Data into Datetime Pin
Blue_Boy19-Jul-08 0:55
Blue_Boy19-Jul-08 0:55 
Questionsql query Pin
ptvce18-Jul-08 23:39
ptvce18-Jul-08 23:39 
AnswerRe: sql query Pin
Blue_Boy19-Jul-08 0:54
Blue_Boy19-Jul-08 0:54 
AnswerRe: sql query Pin
zahedonline21-Jul-08 2:10
zahedonline21-Jul-08 2:10 
QuestionHai Pin
jeena994022076518-Jul-08 19:26
jeena994022076518-Jul-08 19:26 
AnswerRe: Hai PinPopular
N a v a n e e t h18-Jul-08 20:02
N a v a n e e t h18-Jul-08 20:02 

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.