StudentID StudentName
1 selva
2 selvadurai
3 sakthi
4 saravana
5 kumar
"StudentName" should start with "s" and name should have only 5 characters
You3:27 PM
SELECT *
FROM student
WHERE StudentName LIKE 's%'
AND LENGTH(StudentName) = 5;
SELECT StudentName
FROM YourTableName
WHERE StudentName LIKE 's____'
Saravana Kumar3:27 PM
StudentID Mark
1 10
1 20
1 30
2 40
2 50
2 60
3 70
3 80
3 90
StudentIDS Marks
1 10,20,30
2 40,50,60
3 70,80,90
You3:30 PM
SELECT StudentID, GROUP_CONCAT(Mark) AS Marks
FROM student
GROUP BY StudentID;
SELECT
StudentID,
GROUP_CONCAT(Mark ORDER BY Mark ASC) AS Marks
FROM YourTableName
GROUP BY StudentID;
No comments:
Post a Comment