Click here to Skip to main content
15,914,820 members
Home / Discussions / Database
   

Database

 
QuestionSearch creteria based on multiple columns Pin
Ravi Shankar437-Nov-06 20:02
Ravi Shankar437-Nov-06 20:02 
AnswerRe: Search creteria based on multiple columns Pin
PavanPareta9-Nov-06 19:21
PavanPareta9-Nov-06 19:21 
Questiondataware housing Pin
king sunny7-Nov-06 18:47
king sunny7-Nov-06 18:47 
AnswerRe: dataware housing Pin
playout7-Nov-06 18:58
playout7-Nov-06 18:58 
Questionerror browsing reportserver on a sql 2005 64bit machine Pin
playout7-Nov-06 9:16
playout7-Nov-06 9:16 
QuestionConcatenate rows together through SQL query Pin
xoxoxoxoxoxox7-Nov-06 8:04
xoxoxoxoxoxox7-Nov-06 8:04 
JokeRe: Concatenate rows together through SQL query Pin
xoxoxoxoxoxox8-Nov-06 12:21
xoxoxoxoxoxox8-Nov-06 12:21 
AnswerRe: Concatenate rows together through SQL query Pin
Eric Dahlvang9-Nov-06 3:48
Eric Dahlvang9-Nov-06 3:48 
Maybe someone else has a better idea, but I can't think of a pretty way to do this. If the data is ALWAYS in two records, you could try something like:

select ids.id,
(select top 1 column1 from mytesttable t2 where t2.id = IDs.id order by column1) as column1,
(select top 1 column2 from mytesttable t2 where t2.id = IDs.id order by column1) as column2,
(select top 1 column3 from mytesttable t2 where t2.id = IDs.id order by column1) as column3,
(select top 1 column1 from mytesttable t2 where t2.id = IDs.id order by column1 desc) as column4,
(select top 1 column2 from mytesttable t2 where t2.id = IDs.id order by column1 desc) as column5,
(select top 1 column3 from mytesttable t2 where t2.id = IDs.id order by column1 desc) as column6
from (select distinct id from mytesttable) as IDs


Any other solution would probably involve a cursor and/or temporary table.

--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters

GeneralRe: Concatenate rows together through SQL query Pin
xoxoxoxoxoxox9-Nov-06 13:41
xoxoxoxoxoxox9-Nov-06 13:41 
QuestionHow does sql parameters work? Pin
Genbox7-Nov-06 7:23
Genbox7-Nov-06 7:23 
AnswerRe: How does sql parameters work? Pin
Paul Conrad7-Nov-06 7:26
professionalPaul Conrad7-Nov-06 7:26 
GeneralRe: How does sql parameters work? Pin
Genbox7-Nov-06 7:32
Genbox7-Nov-06 7:32 
GeneralRe: How does sql parameters work? Pin
User 17164927-Nov-06 7:36
professionalUser 17164927-Nov-06 7:36 
GeneralRe: How does sql parameters work? Pin
Genbox7-Nov-06 7:47
Genbox7-Nov-06 7:47 
GeneralRe: How does sql parameters work? Pin
Paul Conrad7-Nov-06 7:47
professionalPaul Conrad7-Nov-06 7:47 
GeneralRe: How does sql parameters work? Pin
Paul Conrad7-Nov-06 7:47
professionalPaul Conrad7-Nov-06 7:47 
GeneralRe: How does sql parameters work? Pin
Genbox7-Nov-06 7:51
Genbox7-Nov-06 7:51 
GeneralRe: How does sql parameters work? Pin
Paul Conrad7-Nov-06 8:12
professionalPaul Conrad7-Nov-06 8:12 
QuestionStrategies for auditing table records Pin
Keith Andersch7-Nov-06 5:30
Keith Andersch7-Nov-06 5:30 
AnswerRe: Strategies for auditing table records Pin
Paul Conrad7-Nov-06 7:03
professionalPaul Conrad7-Nov-06 7:03 
AnswerRe: Strategies for auditing table records Pin
Scott Serl7-Nov-06 9:55
Scott Serl7-Nov-06 9:55 
GeneralRe: Strategies for auditing table records Pin
Paul Conrad7-Nov-06 12:37
professionalPaul Conrad7-Nov-06 12:37 
QuestionADO.NET --- sqlclient Pin
vasini7-Nov-06 5:21
vasini7-Nov-06 5:21 
AnswerRe: ADO.NET --- sqlclient Pin
Parwej Ahamad7-Nov-06 5:37
professionalParwej Ahamad7-Nov-06 5:37 
GeneralRe: ADO.NET --- sqlclient Pin
vasini7-Nov-06 8:56
vasini7-Nov-06 8:56 

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.