Hi
In below query it is showing like below
Group 5A 2
SQL
SELECT [GroupName],
CASE
WHEN GroupID = 2 THEN
CONCAT('', [GroupID], '')
END AS Grp
FROM
[[Group]Thanks
Hi
In below query it is showing like below
Group 5A 2
SELECT [GroupName],
CASE
WHEN GroupID = 2 THEN
CONCAT('', [GroupID], '')
END AS Grp
FROM
[[Group]Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Tahir AnsariRank #366 · 6.8K reputationPosted Aug 15, 2023, 2:21 AM EDT
SELECT [GroupName], CASE WHEN [GroupID] = 2 THEN CONCAT('', CAST([GroupID] AS NVARCHAR), '') END AS Grp FROM [Group];Saravanan GanesanRank #153 · 15.1K reputationPosted Aug 16, 2023, 5:42 AM EDT
The provided SQL query uses a
CASEstatement to format specificGroupIDvalues with red and bold styling. To safely display this, fetch results using your preferred programming language, like PHP. Usehtmlspecialcharsfor data safety and loop through results, applying formatting within table cells. Ensure to manage HTML rendering separately from SQL for security and organization.Cr BhargaviRank #420 · 5.9K reputationPosted Aug 16, 2023, 6:51 AM EDT
Hi Ramco, Please use
htmlspecialcharsfor the safe data and loop through results, applying formatting within table cells. It will help you with the delivering the SQL indivually so that you would be able to get the appropriate results