Click here to Skip to main content
15,889,867 members
Home / Discussions / Database
   

Database

 
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 
AnswerRe: -- Is it possible??? -- [modified] Pin
Michael Potter24-May-06 3:41
Michael Potter24-May-06 3:41 
GeneralRe: -- Is it possible??? -- Pin
WetRivrRat24-May-06 4:16
WetRivrRat24-May-06 4:16 
GeneralRe: -- Is it possible??? -- Pin
Eric Dahlvang24-May-06 9:31
Eric Dahlvang24-May-06 9:31 
QuestionPls Help MS Access Pin
achrafus23-May-06 8:46
achrafus23-May-06 8:46 
QuestionSQL Express to Access Pin
Kschuler23-May-06 8:29
Kschuler23-May-06 8:29 
AnswerRe: SQL Express to Access Pin
Eric Dahlvang23-May-06 9:29
Eric Dahlvang23-May-06 9:29 
QuestionBest way to get Today in DateTime Pin
Rob Philpott23-May-06 7:07
Rob Philpott23-May-06 7:07 
AnswerRe: Best way to get Today in DateTime Pin
Eric Dahlvang23-May-06 8:00
Eric Dahlvang23-May-06 8:00 
GeneralRe: Best way to get Today in DateTime Pin
Rob Philpott23-May-06 8:07
Rob Philpott23-May-06 8:07 
GeneralRe: Best way to get Today in DateTime Pin
Eric Dahlvang23-May-06 8:29
Eric Dahlvang23-May-06 8:29 
QuestionInserting Image in my Report (ReportViewer) Pin
anderslundsgard23-May-06 4:28
anderslundsgard23-May-06 4:28 
QuestionProgrammatically Updating a Table with Detail from derived from another Table Pin
AnneThorne23-May-06 3:45
AnneThorne23-May-06 3:45 
QuestionData base connection problem Pin
iz723-May-06 2:28
iz723-May-06 2:28 
QuestionSQL Server does not exist or access denied [modified] Pin
sarah_chandran23-May-06 0:57
sarah_chandran23-May-06 0:57 

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.