Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Erland Sommarskog Newsgroups: microsoft.public.sqlserver.programming Subject: Re: How do I order the columns on a pivot table? Date: Sun, 12 Apr 2020 21:32:14 +0200 Organization: Erland Sommarskog Lines: 16 Message-ID: References: <32b39068-acc8-48ef-ac56-7f80bc2ee65b@googlegroups.com> <1190dedf-2738-452d-bb11-23ad74088e91@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Injection-Info: reader02.eternal-september.org; posting-host="ff96d794c89c0239ea5bf45a2c7528e6"; logging-data="19325"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1961qat9FuLQuWQg4SsJ7Xy" User-Agent: Xnews/2006.08.24 Mime-proxy/2.1.c.0 (Win32) Cancel-Lock: sha1:TU2Raja1LKvyDlqLiHnZWmouCrA= Xref: csiph.com microsoft.public.sqlserver.programming:31356 John Hall (foundarecord@gmail.com) writes: > ParametersUsed does not have a TestID column. But, I think I need to > create a recordset from a join of ParametersUsed and ParameterEntries > PU.ParameterId = PE.ParameterID > I got the impression that it had a TestID from your one of your posts. > So, why is Param1 getting duplicated into Param2 but 3, 4, & 5 are fine? > For this type of problem, it often helps if you post CREATE TABLE statements for your tables, INSERT statements with sample data, enough to illustrate all angles of the problem. This makes it simple to copy and paste into a query window to develop a tested solution. Don't forget to say which version SQL Server you are using.