How do I select the first character of a cell and use that to define what is returned?
Have a look at MySQL "String" and "Control Flow" Functions.
For example:
SELECT IF( LEFT( myField, 1) = 'a', 1, 0) FROM myTable;
will return 1 for the fields that start with 'a' and 0 for all other values
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