sql query doesn't select the right value's I need












0















I'm trying to only select the data with numbers in them (the table looks like this):



eteee 231
wrgrr
test 1
bioo 21
wee


with the query: SELECT address1 FROM ps_address WHERE address1 not like '%[^0-9]%';



but i get all the values right back.










share|improve this question


















  • 1





    WHERE address1 like '%[0-9]%';?

    – jarlh
    Nov 21 '18 at 9:49











  • Is "eteee 231" a single record or two separate records?

    – iminiki
    Nov 21 '18 at 9:54











  • eteee 231 is a single record

    – user10384599
    Nov 21 '18 at 9:56











  • @jarlh's comment does what you need I'm not sure why you had a 'not like' when you wanted a like with the numeric check.

    – Rich Campbell
    Nov 21 '18 at 10:02











  • when i try it with like and not with 'not like' I got no return at all

    – user10384599
    Nov 21 '18 at 10:14
















0















I'm trying to only select the data with numbers in them (the table looks like this):



eteee 231
wrgrr
test 1
bioo 21
wee


with the query: SELECT address1 FROM ps_address WHERE address1 not like '%[^0-9]%';



but i get all the values right back.










share|improve this question


















  • 1





    WHERE address1 like '%[0-9]%';?

    – jarlh
    Nov 21 '18 at 9:49











  • Is "eteee 231" a single record or two separate records?

    – iminiki
    Nov 21 '18 at 9:54











  • eteee 231 is a single record

    – user10384599
    Nov 21 '18 at 9:56











  • @jarlh's comment does what you need I'm not sure why you had a 'not like' when you wanted a like with the numeric check.

    – Rich Campbell
    Nov 21 '18 at 10:02











  • when i try it with like and not with 'not like' I got no return at all

    – user10384599
    Nov 21 '18 at 10:14














0












0








0








I'm trying to only select the data with numbers in them (the table looks like this):



eteee 231
wrgrr
test 1
bioo 21
wee


with the query: SELECT address1 FROM ps_address WHERE address1 not like '%[^0-9]%';



but i get all the values right back.










share|improve this question














I'm trying to only select the data with numbers in them (the table looks like this):



eteee 231
wrgrr
test 1
bioo 21
wee


with the query: SELECT address1 FROM ps_address WHERE address1 not like '%[^0-9]%';



but i get all the values right back.







sql heidisql






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 21 '18 at 9:48







user10384599















  • 1





    WHERE address1 like '%[0-9]%';?

    – jarlh
    Nov 21 '18 at 9:49











  • Is "eteee 231" a single record or two separate records?

    – iminiki
    Nov 21 '18 at 9:54











  • eteee 231 is a single record

    – user10384599
    Nov 21 '18 at 9:56











  • @jarlh's comment does what you need I'm not sure why you had a 'not like' when you wanted a like with the numeric check.

    – Rich Campbell
    Nov 21 '18 at 10:02











  • when i try it with like and not with 'not like' I got no return at all

    – user10384599
    Nov 21 '18 at 10:14














  • 1





    WHERE address1 like '%[0-9]%';?

    – jarlh
    Nov 21 '18 at 9:49











  • Is "eteee 231" a single record or two separate records?

    – iminiki
    Nov 21 '18 at 9:54











  • eteee 231 is a single record

    – user10384599
    Nov 21 '18 at 9:56











  • @jarlh's comment does what you need I'm not sure why you had a 'not like' when you wanted a like with the numeric check.

    – Rich Campbell
    Nov 21 '18 at 10:02











  • when i try it with like and not with 'not like' I got no return at all

    – user10384599
    Nov 21 '18 at 10:14








1




1





WHERE address1 like '%[0-9]%';?

– jarlh
Nov 21 '18 at 9:49





WHERE address1 like '%[0-9]%';?

– jarlh
Nov 21 '18 at 9:49













Is "eteee 231" a single record or two separate records?

– iminiki
Nov 21 '18 at 9:54





Is "eteee 231" a single record or two separate records?

– iminiki
Nov 21 '18 at 9:54













eteee 231 is a single record

– user10384599
Nov 21 '18 at 9:56





eteee 231 is a single record

– user10384599
Nov 21 '18 at 9:56













@jarlh's comment does what you need I'm not sure why you had a 'not like' when you wanted a like with the numeric check.

– Rich Campbell
Nov 21 '18 at 10:02





@jarlh's comment does what you need I'm not sure why you had a 'not like' when you wanted a like with the numeric check.

– Rich Campbell
Nov 21 '18 at 10:02













when i try it with like and not with 'not like' I got no return at all

– user10384599
Nov 21 '18 at 10:14





when i try it with like and not with 'not like' I got no return at all

– user10384599
Nov 21 '18 at 10:14












3 Answers
3






active

oldest

votes


















0














Try this REGEXP:



SELECT address1 FROM ps_address WHERE address1 REGEXP '[[:digit:]]';


This returns the rows containing digits anywhere inside address1.






share|improve this answer
























  • thx that works for me !

    – user10384599
    Nov 21 '18 at 10:29



















1














You can simply write:



SELECT address1 FROM ps_address WHERE address1 like '%[0-9]%';





share|improve this answer
























  • when i try that query I get no return what so ever

    – user10384599
    Nov 21 '18 at 10:11











  • Are you sure the column's name is address1?

    – iminiki
    Nov 21 '18 at 10:14











  • yes i am sure of that

    – user10384599
    Nov 21 '18 at 10:15











  • Remember, my query does not include " ^ " as your original one.

    – iminiki
    Nov 21 '18 at 10:20











  • yes i know, and there is no return at all

    – user10384599
    Nov 21 '18 at 10:23



















0














this will work :



SELECT address1 FROM ps_address WHERE regexp_like(address1,'.*[0-9]+.*');





share|improve this answer


























  • When i try that query I get the error that the regexp_like function doesn't exicst

    – user10384599
    Nov 21 '18 at 10:13











  • its all working in my db i dont know what is heideisql but for orcale i ts working

    – nikhil sugandh
    Nov 21 '18 at 10:32











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53409254%2fsql-query-doesnt-select-the-right-values-i-need%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown
























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Try this REGEXP:



SELECT address1 FROM ps_address WHERE address1 REGEXP '[[:digit:]]';


This returns the rows containing digits anywhere inside address1.






share|improve this answer
























  • thx that works for me !

    – user10384599
    Nov 21 '18 at 10:29
















0














Try this REGEXP:



SELECT address1 FROM ps_address WHERE address1 REGEXP '[[:digit:]]';


This returns the rows containing digits anywhere inside address1.






share|improve this answer
























  • thx that works for me !

    – user10384599
    Nov 21 '18 at 10:29














0












0








0







Try this REGEXP:



SELECT address1 FROM ps_address WHERE address1 REGEXP '[[:digit:]]';


This returns the rows containing digits anywhere inside address1.






share|improve this answer













Try this REGEXP:



SELECT address1 FROM ps_address WHERE address1 REGEXP '[[:digit:]]';


This returns the rows containing digits anywhere inside address1.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 21 '18 at 10:26









forpasforpas

12.5k3424




12.5k3424













  • thx that works for me !

    – user10384599
    Nov 21 '18 at 10:29



















  • thx that works for me !

    – user10384599
    Nov 21 '18 at 10:29

















thx that works for me !

– user10384599
Nov 21 '18 at 10:29





thx that works for me !

– user10384599
Nov 21 '18 at 10:29













1














You can simply write:



SELECT address1 FROM ps_address WHERE address1 like '%[0-9]%';





share|improve this answer
























  • when i try that query I get no return what so ever

    – user10384599
    Nov 21 '18 at 10:11











  • Are you sure the column's name is address1?

    – iminiki
    Nov 21 '18 at 10:14











  • yes i am sure of that

    – user10384599
    Nov 21 '18 at 10:15











  • Remember, my query does not include " ^ " as your original one.

    – iminiki
    Nov 21 '18 at 10:20











  • yes i know, and there is no return at all

    – user10384599
    Nov 21 '18 at 10:23
















1














You can simply write:



SELECT address1 FROM ps_address WHERE address1 like '%[0-9]%';





share|improve this answer
























  • when i try that query I get no return what so ever

    – user10384599
    Nov 21 '18 at 10:11











  • Are you sure the column's name is address1?

    – iminiki
    Nov 21 '18 at 10:14











  • yes i am sure of that

    – user10384599
    Nov 21 '18 at 10:15











  • Remember, my query does not include " ^ " as your original one.

    – iminiki
    Nov 21 '18 at 10:20











  • yes i know, and there is no return at all

    – user10384599
    Nov 21 '18 at 10:23














1












1








1







You can simply write:



SELECT address1 FROM ps_address WHERE address1 like '%[0-9]%';





share|improve this answer













You can simply write:



SELECT address1 FROM ps_address WHERE address1 like '%[0-9]%';






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 21 '18 at 10:03









iminikiiminiki

751620




751620













  • when i try that query I get no return what so ever

    – user10384599
    Nov 21 '18 at 10:11











  • Are you sure the column's name is address1?

    – iminiki
    Nov 21 '18 at 10:14











  • yes i am sure of that

    – user10384599
    Nov 21 '18 at 10:15











  • Remember, my query does not include " ^ " as your original one.

    – iminiki
    Nov 21 '18 at 10:20











  • yes i know, and there is no return at all

    – user10384599
    Nov 21 '18 at 10:23



















  • when i try that query I get no return what so ever

    – user10384599
    Nov 21 '18 at 10:11











  • Are you sure the column's name is address1?

    – iminiki
    Nov 21 '18 at 10:14











  • yes i am sure of that

    – user10384599
    Nov 21 '18 at 10:15











  • Remember, my query does not include " ^ " as your original one.

    – iminiki
    Nov 21 '18 at 10:20











  • yes i know, and there is no return at all

    – user10384599
    Nov 21 '18 at 10:23

















when i try that query I get no return what so ever

– user10384599
Nov 21 '18 at 10:11





when i try that query I get no return what so ever

– user10384599
Nov 21 '18 at 10:11













Are you sure the column's name is address1?

– iminiki
Nov 21 '18 at 10:14





Are you sure the column's name is address1?

– iminiki
Nov 21 '18 at 10:14













yes i am sure of that

– user10384599
Nov 21 '18 at 10:15





yes i am sure of that

– user10384599
Nov 21 '18 at 10:15













Remember, my query does not include " ^ " as your original one.

– iminiki
Nov 21 '18 at 10:20





Remember, my query does not include " ^ " as your original one.

– iminiki
Nov 21 '18 at 10:20













yes i know, and there is no return at all

– user10384599
Nov 21 '18 at 10:23





yes i know, and there is no return at all

– user10384599
Nov 21 '18 at 10:23











0














this will work :



SELECT address1 FROM ps_address WHERE regexp_like(address1,'.*[0-9]+.*');





share|improve this answer


























  • When i try that query I get the error that the regexp_like function doesn't exicst

    – user10384599
    Nov 21 '18 at 10:13











  • its all working in my db i dont know what is heideisql but for orcale i ts working

    – nikhil sugandh
    Nov 21 '18 at 10:32
















0














this will work :



SELECT address1 FROM ps_address WHERE regexp_like(address1,'.*[0-9]+.*');





share|improve this answer


























  • When i try that query I get the error that the regexp_like function doesn't exicst

    – user10384599
    Nov 21 '18 at 10:13











  • its all working in my db i dont know what is heideisql but for orcale i ts working

    – nikhil sugandh
    Nov 21 '18 at 10:32














0












0








0







this will work :



SELECT address1 FROM ps_address WHERE regexp_like(address1,'.*[0-9]+.*');





share|improve this answer















this will work :



SELECT address1 FROM ps_address WHERE regexp_like(address1,'.*[0-9]+.*');






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 21 '18 at 10:04

























answered Nov 21 '18 at 9:55









nikhil sugandhnikhil sugandh

1,2762719




1,2762719













  • When i try that query I get the error that the regexp_like function doesn't exicst

    – user10384599
    Nov 21 '18 at 10:13











  • its all working in my db i dont know what is heideisql but for orcale i ts working

    – nikhil sugandh
    Nov 21 '18 at 10:32



















  • When i try that query I get the error that the regexp_like function doesn't exicst

    – user10384599
    Nov 21 '18 at 10:13











  • its all working in my db i dont know what is heideisql but for orcale i ts working

    – nikhil sugandh
    Nov 21 '18 at 10:32

















When i try that query I get the error that the regexp_like function doesn't exicst

– user10384599
Nov 21 '18 at 10:13





When i try that query I get the error that the regexp_like function doesn't exicst

– user10384599
Nov 21 '18 at 10:13













its all working in my db i dont know what is heideisql but for orcale i ts working

– nikhil sugandh
Nov 21 '18 at 10:32





its all working in my db i dont know what is heideisql but for orcale i ts working

– nikhil sugandh
Nov 21 '18 at 10:32


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53409254%2fsql-query-doesnt-select-the-right-values-i-need%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

'app-layout' is not a known element: how to share Component with different Modules

android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

WPF add header to Image with URL pettitions [duplicate]