Click here to Skip to main content
15,890,282 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Wouldn't it be great... Pin
#realJSOP23-Mar-18 7:46
mve#realJSOP23-Mar-18 7:46 
GeneralRe: Wouldn't it be great... Pin
lopatir23-Mar-18 7:50
lopatir23-Mar-18 7:50 
GeneralRe: Wouldn't it be great... Pin
Stephen Gonzalez23-Mar-18 7:58
Stephen Gonzalez23-Mar-18 7:58 
GeneralRe: Wouldn't it be great... Pin
Jagger B23-Mar-18 13:02
Jagger B23-Mar-18 13:02 
GeneralRe: Wouldn't it be great... Pin
Sandeep Biswha23-Mar-18 15:15
Sandeep Biswha23-Mar-18 15:15 
GeneralRe: Wouldn't it be great... Pin
Single Step Debugger23-Mar-18 12:40
Single Step Debugger23-Mar-18 12:40 
GeneralRe: Wouldn't it be great... Pin
Stephen Gonzalez20-Apr-18 8:54
Stephen Gonzalez20-Apr-18 8:54 
GeneralRe: Wouldn't it be great... Pin
OriginalGriff23-Mar-18 7:25
mveOriginalGriff23-Mar-18 7:25 
Well ... there are scalar functions:
SQL
CREATE FUNCTION justNumeric 
(
	@INP NVARCHAR(20)
)
RETURNS NVARCHAR(20)
AS
BEGIN
	RETURN substring(@INP, PATINDEX('%[0-9]%', @INP), 1+PATINDEX('%[0-9][^0-9]%', @INP+'x')-PATINDEX('%[0-9]%', @INP))
END

SQL
SELECT MIN(dbo.justNumeric(ID)), MAX(dbo.justNumeric(ID)), Fruit
FROM Fruits
GROUP BY Fruit
Still messy code though - a DB redesign is a better approach!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

GeneralRe: Wouldn't it be great... Pin
#realJSOP23-Mar-18 7:47
mve#realJSOP23-Mar-18 7:47 
GeneralRe: Wouldn't it be great... Pin
Jörgen Andersson23-Mar-18 9:47
professionalJörgen Andersson23-Mar-18 9:47 
GeneralRe: Wouldn't it be great... Pin
Single Step Debugger23-Mar-18 12:43
Single Step Debugger23-Mar-18 12:43 
GeneralRe: Wouldn't it be great... Pin
lopatir23-Mar-18 7:29
lopatir23-Mar-18 7:29 
GeneralRe: Wouldn't it be great... Pin
RickZeeland23-Mar-18 7:53
mveRickZeeland23-Mar-18 7:53 
GeneralRe: Wouldn't it be great... Pin
W Balboos, GHB23-Mar-18 8:39
W Balboos, GHB23-Mar-18 8:39 
GeneralRe: Wouldn't it be great... Pin
#realJSOP23-Mar-18 8:59
mve#realJSOP23-Mar-18 8:59 
GeneralRe: Wouldn't it be great... Pin
Eddy Vluggen23-Mar-18 8:39
professionalEddy Vluggen23-Mar-18 8:39 
GeneralRe: Wouldn't it be great... Pin
#realJSOP23-Mar-18 8:56
mve#realJSOP23-Mar-18 8:56 
GeneralRe: Wouldn't it be great... Pin
Eddy Vluggen24-Mar-18 0:31
professionalEddy Vluggen24-Mar-18 0:31 
GeneralRe: Wouldn't it be great... Pin
Richard Deeming23-Mar-18 9:07
mveRichard Deeming23-Mar-18 9:07 
GeneralRe: Wouldn't it be great... Pin
Jörgen Andersson23-Mar-18 10:15
professionalJörgen Andersson23-Mar-18 10:15 
GeneralRe: Wouldn't it be great... Pin
Richard Deeming23-Mar-18 10:24
mveRichard Deeming23-Mar-18 10:24 
GeneralRe: Wouldn't it be great... Pin
Jörgen Andersson23-Mar-18 10:29
professionalJörgen Andersson23-Mar-18 10:29 
GeneralRe: Wouldn't it be great... Pin
Jörgen Andersson23-Mar-18 11:53
professionalJörgen Andersson23-Mar-18 11:53 
GeneralRe: Wouldn't it be great... Pin
Slacker00723-Mar-18 10:35
professionalSlacker00723-Mar-18 10:35 
GeneralRe: Wouldn't it be great... Pin
Richard Deeming23-Mar-18 10:41
mveRichard Deeming23-Mar-18 10:41 

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.