I want to show specific data where all the values start with a letter and ends with a number in the city of cansas only.
What my table looks like:
hotelroom
pID |name | city | key
--------------------------------------------
543 |H. Stein |Cansas | 16Z004
542 |Z. Francis |Cansas | Z10-30
642 |Q. Snake |Cansas | Z10-25
645 |P. Brown |Kentucky | Z10-40
What I want:
pID |name | city | key
--------------------------------------------
542 |Z. Francis |Cansas | Z10-30
642 |Q. Snake |Cansas | Z10-25
What I tried and did not work:
SELECT * FROM hotelroom
WHERE city LIKE '%Cansas%' AND
key LIKE '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ].*[0123456789]$'