I have category ( title ) start with alphabetical A
$sql = "select * from category_data WHERE category LIKE 'A%'";
And is working, but how I can select from database the category ( title )
which don't start with [A-Z]
or [1-9]
just with symbols
If we want to return all columns of the table, we can use a (*) asterisk sign instead of writing whole columns of the table. Through the following query, we can return all columns of the table.
To select rows using selection symbols for character or graphic data, use the LIKE keyword in a WHERE clause, and the underscore and percent sign as selection symbols. You can create multiple row conditions, and use the AND, OR, or IN keywords to connect the conditions.
SELECT * FROM category_data WHERE ASCII(UPPER(LEFT(category,1))) IN(...)
You can pass allowed ASCII characters in your IN
clause.
If you want to skip specific range, you can use NOT BETWEEN x AND y;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With