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

Database

 
GeneralRe: Replace function Pin
Jay Royall3-Dec-08 1:35
Jay Royall3-Dec-08 1:35 
GeneralRe: Replace function Pin
Ben Fair3-Dec-08 3:54
Ben Fair3-Dec-08 3:54 
GeneralRe: Replace function Pin
Jay Royall3-Dec-08 4:17
Jay Royall3-Dec-08 4:17 
QuestionDuplicate in join Pin
gnjunge2-Dec-08 2:25
gnjunge2-Dec-08 2:25 
AnswerRe: Duplicate in join Pin
Wendelius2-Dec-08 2:52
mentorWendelius2-Dec-08 2:52 
GeneralRe: Duplicate in join Pin
gnjunge2-Dec-08 2:57
gnjunge2-Dec-08 2:57 
GeneralRe: Duplicate in join Pin
Wendelius2-Dec-08 3:11
mentorWendelius2-Dec-08 3:11 
AnswerRe: Duplicate in join [modified] Pin
Blue_Boy2-Dec-08 9:11
Blue_Boy2-Dec-08 9:11 
gnjunge wrote:
I have a dirty subselect


I hope this T-SQL is not "dirty" but I couldn't make shorter,I hope too this T-SQL will help you.

select id,<br />
(select top 1 A.ID from nicknames as A where A.nameID = names.ID) as NicknameID,<br />
name,<br />
(select top 1 A.nickname from nicknames as A where A.nameID = names.ID) as Nickname<br />
from names<br />
where (names.name like 'b%')<br />
or names.id in (select C.nameid from nicknames as C where C.nickname like 'b%' ) </code><br />
<br />
Result is :<br />
<br />
<code>1	1	John	Bonny<br />
3	5	Carl	Bab<br />
4	NULL	Bernard	NULL



I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.

GeneralRe: Duplicate in join Pin
gnjunge2-Dec-08 20:21
gnjunge2-Dec-08 20:21 
GeneralRe: Duplicate in join Pin
Blue_Boy3-Dec-08 0:24
Blue_Boy3-Dec-08 0:24 
QuestionPassing multiple records to one stored proc Pin
Hamed Musavi2-Dec-08 1:05
Hamed Musavi2-Dec-08 1:05 
AnswerRe: Passing multiple records to one stored proc Pin
Ben Fair2-Dec-08 4:12
Ben Fair2-Dec-08 4:12 
GeneralRe: Passing multiple records to one stored proc Pin
Hamed Musavi2-Dec-08 4:57
Hamed Musavi2-Dec-08 4:57 
GeneralRe: Passing multiple records to one stored proc Pin
Wendelius2-Dec-08 10:25
mentorWendelius2-Dec-08 10:25 
AnswerRe: Passing multiple records to one stored proc Pin
Wendelius2-Dec-08 10:22
mentorWendelius2-Dec-08 10:22 
GeneralRe: Passing multiple records to one stored proc Pin
Hamed Musavi2-Dec-08 19:02
Hamed Musavi2-Dec-08 19:02 
GeneralRe: Passing multiple records to one stored proc Pin
Wendelius3-Dec-08 7:09
mentorWendelius3-Dec-08 7:09 
GeneralRe: Passing multiple records to one stored proc Pin
Hamed Musavi3-Dec-08 9:10
Hamed Musavi3-Dec-08 9:10 
GeneralRe: Passing multiple records to one stored proc Pin
Wendelius3-Dec-08 9:39
mentorWendelius3-Dec-08 9:39 
GeneralRe: Passing multiple records to one stored proc Pin
Hamed Musavi3-Dec-08 9:48
Hamed Musavi3-Dec-08 9:48 
GeneralRe: Passing multiple records to one stored proc Pin
Wendelius3-Dec-08 10:06
mentorWendelius3-Dec-08 10:06 
GeneralRe: Passing multiple records to one stored proc Pin
Ben Fair3-Dec-08 3:59
Ben Fair3-Dec-08 3:59 
GeneralRe: Passing multiple records to one stored proc Pin
Wendelius3-Dec-08 7:20
mentorWendelius3-Dec-08 7:20 
QuestionIMAGE IN SQL REPORTING SERVICES Pin
member272-Dec-08 1:02
member272-Dec-08 1:02 
AnswerRe: IMAGE IN SQL REPORTING SERVICES Pin
ChandraRam2-Dec-08 2:14
ChandraRam2-Dec-08 2:14 

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.