Click here to Skip to main content
15,892,072 members
Home / Discussions / Database
   

Database

 
AnswerConsider XML storage Pin
David Mujica17-Dec-09 5:28
David Mujica17-Dec-09 5:28 
QuestionSelect Query with column name containing [] [Figured out] Pin
dan!sh 16-Dec-09 18:52
professional dan!sh 16-Dec-09 18:52 
AnswerRe: Select Query with column name containing [] Pin
Mycroft Holmes16-Dec-09 18:59
professionalMycroft Holmes16-Dec-09 18:59 
GeneralRe: Select Query with column name containing [] Pin
dan!sh 16-Dec-09 19:01
professional dan!sh 16-Dec-09 19:01 
GeneralRe: Select Query with column name containing [] Pin
Mycroft Holmes16-Dec-09 19:50
professionalMycroft Holmes16-Dec-09 19:50 
GeneralRe: Select Query with column name containing [] Pin
dan!sh 16-Dec-09 21:16
professional dan!sh 16-Dec-09 21:16 
QuestionHow to group data which not the same ? Pin
Golden Jing15-Dec-09 23:06
Golden Jing15-Dec-09 23:06 
AnswerRe: How to group data which not the same ? Pin
Niladri_Biswas16-Dec-09 2:00
Niladri_Biswas16-Dec-09 2:00 
Try this

declare @t table(Company_Name varchar(50))
insert into @t 
	select 'ComxxxA Co.' union all select 'ComxxxA Co.' union all
	select 'ComxxxA Co.,Ltd.' union all select 'ComxxxA Co.,Ltd.' union all
	select' ComxxxA Co.,' union all select 'ComxxxA Co.,' union all
	select 'ComxxxA ' union all select 'ComxxxA ' union all 
	select 'Comx' union all select 'ComxxxxxxxB Co.,Ldt' union all
	select 'ComxxxxxxxB Co.,Ldt' union all select 'ComxxxxxxxB Co.,Ldt' union all
	select 'ComxxxxxxxB Co.,Ldt' union all select 'ComxxxxxxxB Co' union all
	select 'ComxxxxxxxB Co.,' union all select 'ComxxxxxxxB Co.,'


Query:

select  Company_Name
from @t 
where replace(Company_Name, ' ','') not like '%[.,]%'
group by Company_Name 


Output:

Company_Name
Comx
ComxxxA 
ComxxxxxxxB Co


Smile | :)

Niladri Biswas

GeneralRe: How to group data which not the same ? Pin
Golden Jing16-Dec-09 2:29
Golden Jing16-Dec-09 2:29 
General[Message Deleted] Pin
Niladri_Biswas16-Dec-09 3:23
Niladri_Biswas16-Dec-09 3:23 
GeneralRe: How to group data which not the same ? Pin
Golden Jing16-Dec-09 14:51
Golden Jing16-Dec-09 14:51 
AnswerRe: How to group data which not the same ? Pin
Luc Pattyn16-Dec-09 15:03
sitebuilderLuc Pattyn16-Dec-09 15:03 
QuestionADODB Recordset - using ActiveX Data Object in Access 2007 Pin
john john mackey15-Dec-09 12:38
john john mackey15-Dec-09 12:38 
QuestionMS-SQL - Bulk Insert query Pin
22491715-Dec-09 11:50
22491715-Dec-09 11:50 
AnswerRe: MS-SQL - Bulk Insert query Pin
Ashfield15-Dec-09 21:01
Ashfield15-Dec-09 21:01 
GeneralRe: MS-SQL - Bulk Insert query Pin
22491716-Dec-09 6:14
22491716-Dec-09 6:14 
QuestionQuestion about using conditional SQL statement Pin
James Shao15-Dec-09 4:22
James Shao15-Dec-09 4:22 
AnswerRe: Question about using conditional SQL statement [modified] Pin
Ashfield15-Dec-09 4:34
Ashfield15-Dec-09 4:34 
GeneralRe: Question about using conditional SQL statement [modified] Pin
James Shao15-Dec-09 15:02
James Shao15-Dec-09 15:02 
GeneralRe: Question about using conditional SQL statement Pin
Ashfield15-Dec-09 20:57
Ashfield15-Dec-09 20:57 
AnswerCROSS POST Pin
dan!sh 15-Dec-09 5:08
professional dan!sh 15-Dec-09 5:08 
GeneralRe: CROSS POST Pin
James Shao15-Dec-09 12:46
James Shao15-Dec-09 12:46 
QuestionSql Doubt Pin
rajanandal15-Dec-09 2:26
rajanandal15-Dec-09 2:26 
AnswerRe: Sql Doubt Pin
Richard MacCutchan15-Dec-09 2:39
mveRichard MacCutchan15-Dec-09 2:39 
GeneralRe: Sql Doubt Pin
rajanandal15-Dec-09 2:53
rajanandal15-Dec-09 2:53 

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.