How can I only select rows that contains column-Grade value like Grade 1, Grade 10, Grade 11, Grade 12... from the table?
答案 0 :(得分:1)
尝试这样的想法:
SELECT *
FROM t
WHERE Grade LIKE 'Grade 1%'
答案 1 :(得分:0)
Get the grade
column value vertically like below
SELECT SUBSTRING_INDEX(Grade,'-',1) FROM table_name
and then after convert them to rows
答案 2 :(得分:0)
嘿,你可以这样试试
select * from tableName where SUBSTRING_INDEX(Grade,'-',1) = 'Grade 1';