Hello. At performance of the labs, concerning line functions it faced the interesting task. There is an example:
SELECT COUNT(passport_series) WHERE POSITION('0301' IN 'passport_series') > 0 FROM students; The essence of the task is to count the number of students whose passport series is equal to "0301". My code caused doubts. After all, the function "POSITION" returns the symbol number (occurrences) of it in the string, well, or the number of the substring entry in the string, right? He asked the teacher, and he says that everything is correct. Naturally knocks an error - another and did not expect. The question is, how can you count the number of students with this series of passports, with the help of some line function, and in general is there such? Thank.
WHERE passport_series = '0301'? - Vismanupdate/insert set series=0301i.e. without quotes. If the database contains valid data, then search by the usual equalitywhere series='0301'- Mike