Click here to Skip to main content
15,896,606 members
Home / Discussions / Database
   

Database

 
AnswerRe: How to make unique, readable, varchar codes in a Guid ID table Pin
εїзεїзεїз2-Nov-09 20:51
εїзεїзεїз2-Nov-09 20:51 
Questionhow to write querey return the unique CustomerId with the first CustomerName ? Pin
AJ Hoge1-Nov-09 23:49
AJ Hoge1-Nov-09 23:49 
AnswerRe: how to write querey return the unique CustomerId with the first CustomerName ? Pin
il_masacratore2-Nov-09 0:32
il_masacratore2-Nov-09 0:32 
GeneralRe: how to write querey return the unique CustomerId with the first CustomerName ? Pin
AJ Hoge2-Nov-09 4:42
AJ Hoge2-Nov-09 4:42 
AnswerRe: how to write querey return the unique CustomerId with the first CustomerName ? Pin
J4amieC2-Nov-09 1:18
J4amieC2-Nov-09 1:18 
GeneralRe: how to write querey return the unique CustomerId with the first CustomerName ? Pin
AJ Hoge2-Nov-09 4:51
AJ Hoge2-Nov-09 4:51 
GeneralRe: how to write querey return the unique CustomerId with the first CustomerName ? Pin
J4amieC2-Nov-09 6:35
J4amieC2-Nov-09 6:35 
AnswerRe: how to write querey return the unique CustomerId with the first CustomerName ? Pin
Niladri_Biswas2-Nov-09 4:51
Niladri_Biswas2-Nov-09 4:51 
You can even try this

declare @tblcustomer table(customerid int,customername varchar(50))
insert into @tblcustomer
select 12,'Jone' union all select 25,'Mark' union all
select 25,'Marc' union all select 10,'AJ'

select x.customerid
		,x.customername
		from
		(
	select 
		ROW_NUMBER() over (partition by customerid order by customerid) as rn
		,customerid
		,customername
	from @tblcustomer)X(rn,customerid,customername)
	where rn = 1


Output:
customerid	customername
10	          AJ
12	          Jone
25	           Mark

Smile | :)

Niladri Biswas

QuestionRe: how to write querey return the unique CustomerId with the first CustomerName ? Pin
i.j.russell2-Nov-09 5:14
i.j.russell2-Nov-09 5:14 
QuestionDetaching SQL Database .mdf file ! Pin
jeshra2791-Nov-09 18:36
jeshra2791-Nov-09 18:36 
AnswerRe: Detaching SQL Database .mdf file ! Pin
Mycroft Holmes1-Nov-09 20:01
professionalMycroft Holmes1-Nov-09 20:01 
GeneralRe: Detaching SQL Database .mdf file ! Pin
jeshra2791-Nov-09 20:13
jeshra2791-Nov-09 20:13 
GeneralRe: Detaching SQL Database .mdf file ! Pin
Mycroft Holmes1-Nov-09 20:20
professionalMycroft Holmes1-Nov-09 20:20 
AnswerRe: Detaching SQL Database .mdf file ! Pin
Abhishek Sur1-Nov-09 21:59
professionalAbhishek Sur1-Nov-09 21:59 
QuestionCan't Create database Pin
twsted f81-Nov-09 7:15
twsted f81-Nov-09 7:15 
AnswerRe: Can't Create database Pin
Andy_L_J1-Nov-09 7:47
Andy_L_J1-Nov-09 7:47 
AnswerRe: Can't Create database Pin
Mycroft Holmes1-Nov-09 11:11
professionalMycroft Holmes1-Nov-09 11:11 
AnswerRe: Can't Create database Pin
Henry Minute1-Nov-09 11:24
Henry Minute1-Nov-09 11:24 
GeneralRe: Can't Create database Pin
Andy_L_J1-Nov-09 11:55
Andy_L_J1-Nov-09 11:55 
GeneralRe: Can't Create database Pin
Henry Minute2-Nov-09 0:25
Henry Minute2-Nov-09 0:25 
QuestionUpdate Master Database Daily comparing with old one Pin
RAJAGOPAL PATABALLA30-Oct-09 5:14
RAJAGOPAL PATABALLA30-Oct-09 5:14 
AnswerRe: Update Master Database Daily comparing with old one Pin
David Mujica30-Oct-09 5:38
David Mujica30-Oct-09 5:38 
AnswerRe: Update Master Database Daily comparing with old one Pin
Henry Minute30-Oct-09 10:30
Henry Minute30-Oct-09 10:30 
AnswerRe: Update Master Database Daily comparing with old one Pin
εїзεїзεїз31-Oct-09 20:10
εїзεїзεїз31-Oct-09 20:10 
QuestionSQL To XML Pin
Vimalsoft(Pty) Ltd30-Oct-09 4:59
professionalVimalsoft(Pty) Ltd30-Oct-09 4:59 

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.