Click here to Skip to main content
15,903,385 members
Home / Discussions / Database
   

Database

 
GeneralRe: Challenging DB Quest. (Tree-Node) Pin
Dinuj Nath25-May-06 19:07
Dinuj Nath25-May-06 19:07 
QuestionRestoring a BAK file (created suing SQL Server 2000) in SQL Server 2005 Pin
spirit_kleptus24-May-06 7:27
spirit_kleptus24-May-06 7:27 
QuestionConnectionString Changes during Runtime? Pin
DEWright_CA24-May-06 5:38
DEWright_CA24-May-06 5:38 
Questionreturning a user group in MS Access Pin
achrafus24-May-06 4:07
achrafus24-May-06 4:07 
QuestionInserting lots of rows programmatically Pin
AnneThorne24-May-06 2:59
AnneThorne24-May-06 2:59 
AnswerRe: Inserting lots of rows programmatically Pin
john.nada24-May-06 5:33
john.nada24-May-06 5:33 
GeneralRe: Inserting lots of rows programmatically Pin
AnneThorne24-May-06 8:59
AnneThorne24-May-06 8:59 
GeneralRe: Inserting lots of rows programmatically Pin
Eric Dahlvang24-May-06 11:59
Eric Dahlvang24-May-06 11:59 
GeneralRe: Inserting lots of rows programmatically Pin
john.nada24-May-06 12:07
john.nada24-May-06 12:07 
QuestionODP.NET vs System.Data.OracleClient Pin
CooperWu24-May-06 0:11
CooperWu24-May-06 0:11 
AnswerRe: ODP.NET vs System.Data.OracleClient Pin
CooperWu24-May-06 0:36
CooperWu24-May-06 0:36 
AnswerRe: Query With Collection Values Pin
CooperWu24-May-06 0:19
CooperWu24-May-06 0:19 
QuestionParameterized query Pin
dayakar_dn23-May-06 23:50
dayakar_dn23-May-06 23:50 
AnswerRe: Parameterized query Pin
CooperWu24-May-06 0:24
CooperWu24-May-06 0:24 
AnswerRe: Parameterized query [modified] Pin
Luis Alonso Ramos24-May-06 19:49
Luis Alonso Ramos24-May-06 19:49 
Questioncreate forenkey syntex Pin
vipinpaliwal198023-May-06 22:19
vipinpaliwal198023-May-06 22:19 
AnswerRe: create forenkey syntex Pin
maryamf24-May-06 12:03
maryamf24-May-06 12:03 
AnswerRe: create forenkey syntex Pin
Colin Angus Mackay25-May-06 9:41
Colin Angus Mackay25-May-06 9:41 
GeneralRe: create forenkey syntex Pin
vipinpaliwal198025-May-06 17:54
vipinpaliwal198025-May-06 17:54 
QuestionDbf Tables & Sql Strings Pin
Vinicius Pontes23-May-06 10:11
Vinicius Pontes23-May-06 10:11 
AnswerRe: Dbf Tables & Sql Strings Pin
Eric Dahlvang24-May-06 3:06
Eric Dahlvang24-May-06 3:06 
Question-- Is it possible??? -- Pin
WetRivrRat23-May-06 9:56
WetRivrRat23-May-06 9:56 
Hey guys, need to format a column of results to display as columns in another query.... let me explain a little better *hopefully*
in the result set below notice how the empID is repeated in some cases
ID          empID       phone_num    displayTel type
----------- ----------- ------------ ---------- -----------
        159         625 123-123-4567          1           1
        163         625 465-456-4657          1           1
        154         626 944-789-4515          1           1
        155         626 984-321-4567          1           2
        150         639 984-266-3336          1           1
        145         802 465-465-7894          1           5
        146         802 654-798-4657          1           6
        165         853 132-123-1324          1           1

i need to beable to separate the "phone_num" data based on the "type" and then display that data in-line on another query
i.e.

Not This!!!
  Name          empID       phone_num  activeUser contact
----------- ----------- ------------ ---------- -----------
  Demo User         625 123-123-4567          1           1
  Demo User         625 465-456-4657          1           1


Instead Like This!!
Name        empID       phone_num1   phone_num2   activeUser contact
----------- ----------- ------------ ------------ ---------- -----------
  Demo User         625 123-123-4567 465-456-4657          1           1


I need to be able to do this all at once while i'm also quering about 15 other tables.... so i need to be able to do it in-line or subqueried...

my only idea would be to do something like this ('course it won't work))
<br />
SELECT col1, col2, (if (select phone_num from phone where empID = @empIDNum) > 1 <br />
{<br />
for i = 1 to (select count(phone_num)) <br />
select top (i) phone_num as phone_num+(i) from Phone where empID = @empIDNum <br />
Next}<br />
)<br />
else<br />
{<br />
	select phone_num from phone where empID = @empIDNum<br />
}<br />
from employees<br />


thanks!!!

string Beautiful;
Beautiful = "ignorant";
label1.Text = "The world is full of " + Beautiful +" people.";


Why is common sense such an un-common comodity?
AnswerRe: -- Is it possible??? -- Pin
Eric Dahlvang24-May-06 3:36
Eric Dahlvang24-May-06 3:36 
GeneralRe: -- Is it possible??? -- Pin
WetRivrRat24-May-06 4:01
WetRivrRat24-May-06 4:01 
AnswerRe: -- Is it possible??? -- Pin
Eric Dahlvang24-May-06 8:35
Eric Dahlvang24-May-06 8:35 

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.