Click here to Skip to main content
15,891,567 members
Home / Discussions / Database
   

Database

 
AnswerRe: Query Help Pin
Wendelius25-Dec-08 7:13
mentorWendelius25-Dec-08 7:13 
QuestionSplit function Pin
cbe_pav24-Dec-08 1:43
cbe_pav24-Dec-08 1:43 
AnswerRe: Split function Pin
Paddy Boyd24-Dec-08 1:53
Paddy Boyd24-Dec-08 1:53 
AnswerRe: Split function Pin
cbe_pav24-Dec-08 17:41
cbe_pav24-Dec-08 17:41 
AnswerRe: Split function Pin
Niladri_Biswas1-Jul-09 18:33
Niladri_Biswas1-Jul-09 18:33 
QuestionSql server 2005 Pin
Nath23-Dec-08 22:59
Nath23-Dec-08 22:59 
AnswerRe: Sql server 2005 Pin
Krish - KP24-Dec-08 0:08
Krish - KP24-Dec-08 0:08 
AnswerRe: Sql server 2005 Pin
Wendelius24-Dec-08 1:30
mentorWendelius24-Dec-08 1:30 
You can join the same table several times. Just use different aliases. Something like:
select table1.contactId,
       table1.Str_name,
       alias1.str_phonenumber,
       alias2.str_phonenumber
from   table1,
       table2 alias1,
       table2 alias2
where  alias1.contactId = table1.contactId
and    alias2.contactId = table1.contactId
and    alias1.Str_phonetype = 'M1'
and    alias2.Str_phonetype = 'L1'

Most likely you want to use outer join if there are no matching rows in table2.

The need to optimize rises from a bad design.My articles[^]

GeneralRe: Sql server 2005 Pin
Nath24-Dec-08 1:54
Nath24-Dec-08 1:54 
GeneralRe: Sql server 2005 Pin
Wendelius24-Dec-08 2:09
mentorWendelius24-Dec-08 2:09 
GeneralRe: Sql server 2005 Pin
Nath25-Dec-08 18:31
Nath25-Dec-08 18:31 
GeneralRe: Sql server 2005 Pin
Wendelius25-Dec-08 21:50
mentorWendelius25-Dec-08 21:50 
GeneralRe: Sql server 2005 Pin
Nath25-Dec-08 22:35
Nath25-Dec-08 22:35 
GeneralRe: Sql server 2005 Pin
Wendelius25-Dec-08 22:43
mentorWendelius25-Dec-08 22:43 
GeneralRe: Sql server 2005 Pin
Nath25-Dec-08 22:39
Nath25-Dec-08 22:39 
GeneralRe: Sql server 2005 Pin
Wendelius25-Dec-08 23:11
mentorWendelius25-Dec-08 23:11 
GeneralRe: Sql server 2005 Pin
Nath25-Dec-08 23:45
Nath25-Dec-08 23:45 
GeneralRe: Sql server 2005 Pin
Wendelius26-Dec-08 1:06
mentorWendelius26-Dec-08 1:06 
QuestionPLSQL ? ORA-01401: inserted value too large for column Pin
Reddy Prakash23-Dec-08 21:44
Reddy Prakash23-Dec-08 21:44 
AnswerRe: PLSQL ? ORA-01401: inserted value too large for column Pin
Reddy Prakash23-Dec-08 22:00
Reddy Prakash23-Dec-08 22:00 
AnswerRe: PLSQL ? ORA-01401: inserted value too large for column Pin
Wendelius23-Dec-08 22:07
mentorWendelius23-Dec-08 22:07 
QuestionCreate a folder with full Sharing Rights Pin
pdnet23-Dec-08 19:04
pdnet23-Dec-08 19:04 
AnswerHabitual Cross-Poster Pin
Rob Graham27-Dec-08 4:23
Rob Graham27-Dec-08 4:23 
QuestionSuper basic databinding Pin
Brice1423-Dec-08 16:05
Brice1423-Dec-08 16:05 
AnswerRe: Super basic databinding Pin
Syed Mehroz Alam23-Dec-08 19:03
Syed Mehroz Alam23-Dec-08 19:03 

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.