Click here to Skip to main content
15,898,868 members
Home / Discussions / Database
   

Database

 
GeneralRe: Order by Pin
samson radu2-Aug-11 3:06
samson radu2-Aug-11 3:06 
AnswerRe: mysql SELECT WHERE Pin
Nagy Vilmos2-Aug-11 22:27
professionalNagy Vilmos2-Aug-11 22:27 
QuestionError trapping in SQL Server 2005 [modified] Pin
vanikanc1-Aug-11 7:37
vanikanc1-Aug-11 7:37 
AnswerRe: Error trapping in SQL Server 2005 Pin
jschell1-Aug-11 8:25
jschell1-Aug-11 8:25 
GeneralRe: Error trapping in SQL Server 2005 Pin
vanikanc1-Aug-11 8:29
vanikanc1-Aug-11 8:29 
GeneralRe: Error trapping in SQL Server 2005 Pin
jschell2-Aug-11 9:18
jschell2-Aug-11 9:18 
AnswerRe: Error trapping in SQL Server 2005 Pin
Shameel1-Aug-11 8:59
professionalShameel1-Aug-11 8:59 
AnswerRe: Error trapping in SQL Server 2005 Pin
Mycroft Holmes1-Aug-11 13:01
professionalMycroft Holmes1-Aug-11 13:01 
AnswerRe: Error trapping in SQL Server 2005 Pin
thatraja1-Aug-11 15:00
professionalthatraja1-Aug-11 15:00 
QuestionDynamic sort Pin
vanikanc1-Aug-11 2:54
vanikanc1-Aug-11 2:54 
AnswerRe: Dynamic sort Pin
Herman<T>.Instance1-Aug-11 3:15
Herman<T>.Instance1-Aug-11 3:15 
GeneralRe: Dynamic sort Pin
vanikanc1-Aug-11 3:45
vanikanc1-Aug-11 3:45 
GeneralRe: Dynamic sort Pin
Corporal Agarn1-Aug-11 5:18
professionalCorporal Agarn1-Aug-11 5:18 
AnswerRe: Dynamic sort [modified] Pin
Shameel1-Aug-11 5:30
professionalShameel1-Aug-11 5:30 
GeneralRe: Dynamic sort Pin
vanikanc1-Aug-11 7:34
vanikanc1-Aug-11 7:34 
AnswerRe: Dynamic sort Pin
jschell1-Aug-11 8:34
jschell1-Aug-11 8:34 
QuestionStored Procedure to find emails Pin
Tiger45631-Jul-11 7:08
Tiger45631-Jul-11 7:08 
AnswerRe: Stored Procedure to find emails [modified] Pin
Shameel31-Jul-11 7:20
professionalShameel31-Jul-11 7:20 
Create a bridge table between CustomerType and EmailDesignation and fill it with data that represents the relationship you specified above. You can then create a query that joins these three tables to get the data that you require.

You also need to create a new table with email designations and their priority.

SQL
SELECT TOP 2 C.CustomerName, Co.CustomerType, E.Email, E.Designation
FROM Customer C
INNER JOIN CustomerEmailBridge B ON C.CustomerType = B.CustomerType
INNER JOIN Email E ON B.EmailDesignation = E.EmailDesignation
INNER JOIN EmailPriority P ON E.EmailDesignation = P.EmailDesignation AND B.CustomerType = P.CustomerType
WHERE (C.CustomerID = @CustomerID)
ORDER BY P.Priority


modified on Tuesday, August 2, 2011 2:48 PM

GeneralRe: Stored Procedure to find emails Pin
Tiger45631-Jul-11 7:41
Tiger45631-Jul-11 7:41 
GeneralRe: Stored Procedure to find emails Pin
Shameel31-Jul-11 7:47
professionalShameel31-Jul-11 7:47 
GeneralRe: Stored Procedure to find emails Pin
Anish Gopi2-Aug-11 2:02
sitebuilderAnish Gopi2-Aug-11 2:02 
GeneralRe: Stored Procedure to find emails Pin
Shameel2-Aug-11 8:45
professionalShameel2-Aug-11 8:45 
Question[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. Pin
nazimghori31-Jul-11 1:14
nazimghori31-Jul-11 1:14 
AnswerRe: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. Pin
thatraja31-Jul-11 6:03
professionalthatraja31-Jul-11 6:03 
AnswerRe: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. Pin
Shameel31-Jul-11 7:23
professionalShameel31-Jul-11 7:23 

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.