I need to get a SQL Query that I can 开发者_高级运维execute to extract certain data. Here are the details:
- DB Type: MySQL
- DB Name: adminDB
- Table Name: licenseinfo
- Field Name: LicenseNumber
So the data in the LicenseNumber Column looks like this: ( this is just a sample there are 300,000 Records)
SSCY-334-0W2-5AA
SSCY-238-2W1-5F9
SSCY-378-0W5-5BD
SSCY-312-061-5PO
SSCF-323-0R2-5FW
SSCF-548-2U1-5OL
SSCF-332-0G5-5BY
SSCF-398-041-5PE
I need to extract all records that have SSCF in the LicenseNumber
I tried query builder in SQLYog but I was getting syntax errors.
Can Someone please write this query for me.
Assuming the letters are always at the start:
SELECT * FROM licenseinfo WHERE LicenseNumber LIKE 'SSCF%'
If you really do mean that the text 'SSCF' can be anywhere in the license number you can use LIKE '%SSCF%' instead, but if your sample data is representative, I think this will return the same results but be slower.
I think this should work:
select * from licenseinfo where LicenseNumber like 'SSCF%'
精彩评论