SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


T-sql Select statement


T-sql Select statement

Author
Message
cmoloto-996602
cmoloto-996602
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 136
i need to write a select statement that will show that there are duplicates. the first 4 are duplicates. so are the last 4. The Select statement must show only 2 results since there 2 duplicates

+27828214883
0828214883
27828214883
828214883
+27834793687
0834793687
27834793687
834793687
grahamc
grahamc
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1396 Visits: 1039
cmoloto-996602 (10/6/2010)
i need to write a select statement that will sure that there are duplicates. the first 4 are duplicates. so are the last 4.

+27828214883
0828214883
27828214883
828214883
+27834793687
0834793687
27834793687
834793687


South African cellphone numbers... interesting...

I would be tempted to look at the last 9 characters, like this:

SELECT '+27(0)' + RIGHT(cellNumber, 9)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search