🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: bit.databases.mssql-l
Article #2

Re: query??

#2
From: oj
Date: Wed, 03 Sep 2003 07:46
59 lines
2526 bytes
If you know in advance the number of columns in the result set, try:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q175574.

If you have a variable number of columns, try:
http://www.sqlmag.com/Articles/Index.cfm?ArticleID=15608

If you want some interesting utilities to do it for you, try:
http://www.ag-software.com/AGS/xp ags crosstab.asp

RAC at:
www.rac4sql.net



-- 
-oj
RAC v2.2 & QALite!
http://www.rac4sql.net



"ricksql@yahoo.com" <u50415039@spawnkill.ip-mobilphone.net> wrote in message
news:l.1062563763.1400665283@host-66-81-69-23.rev.o1.com...
> #temptable (studentID,p/f,examid,examname):
> 1   p
> 2   f    100  bio
> 2   f    101  mTH
> 2   f    102  CHM
> 2   f    103  spts
> 2   f    104  LIT
> 2   f    107  geo
> 2   f    109  phys
> 2   f    110  eng
> 2   f    111  hist
> 3   p
> 4   f    100  bio
> 4   f    102  chm
> 4   f    109  phys
> 4   f    110  eng
>
> #tempResult:
>
> (studentid,p/f,1st,2st,3rd,4th,5th)
> 1  p
> 2  f   bio  math  chm  spts  lit
> 3  p
> 4  f   bio  chm  phys  eng
>
>
> what query turns #temptable to #tempresult?.
> rick
>
>
>
>
> -- 
> Sent  by  ricksql from yahoo in field com
> This is a spam protected message. Please answer with reference header.
> Posted via http://www.usenet-replayer.com/cgi/content/new
Technical Details
Message-ID: <eZ1YW8ecDHA.1272@TK2MSFTNGP12.phx.gbl>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!xmission!news-hog.berkeley.edu!ucberkeley!cyclone.bc.net!msrtrans1!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
References: <l.1062563763.1400665283@host-66-81-69-23.rev.o1.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f6611,491a6121cd5fc1c6
X-Google-Attributes: gidf6611,public
X-Google-Thread: 107d2f,491a6121cd5fc1c6
X-Google-Attributes: gid107d2f,public
X-Google-Thread: 104de1,491a6121cd5fc1c6
X-Google-Attributes: gid104de1,public
X-Google-Thread: 11301e,491a6121cd5fc1c6
X-Google-Attributes: gid11301e,public
X-Google-ArrivalTime: 2003-09-03 00:45:17 PST
From: "oj" <nospam_ojngo@home.com>
References: <l.1062563763.1400665283@host-66-81-69-23.rev.o1.com>
Subject: Re: query??
Date: Wed, 3 Sep 2003 00:46:24 -0700
Lines: 61
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <eZ1YW8ecDHA.1272@TK2MSFTNGP12.phx.gbl>
Newsgroups: bit.databases.mssql-l,comp.databases.ms-sqlserver,microsoft.public.sqlserver,microsoft.public.sqlserver.programming
NNTP-Posting-Host: 12-212-21-253.client.attbi.com 12.212.21.253
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!xmission!news-hog.berkeley.edu!ucberkeley!cyclone.bc.net!msrtrans1!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl