Reputation: 1
I have a numbers column in my sql table and I want to pull all the numbers that start with 3 specific digits; how would I query this?
Upvotes: 0
Views: 1602
Reputation: 126
Use the "LIKE" query:
123 is the prefix. I think you have to store the numbers as strings though, just try it out on your data set :-)
SELECT * from TableName Where ColumnName LIKE '123%'
See also this Q&A: In MySql, find strings with a given prefix
Upvotes: 1