Using C#.Net and MYSQL
I want to use a CASE Statement like SQL
Query
SELECT vehicleno,
brandname,
CASE
WHEN inexpire < 0 THEN 'Expired'
ELSE inexpire
END AS inexpire
FROM (SELECT Concat(plateno, vehicleno) AS vehicleno,
brandname,
Datediff(inedate, Curdate()) AS inexpire
FROM tb_car
WHERE inedate < DATE_ADD(Curdate(), INTERVAL 30 DAY)
GROUP BY vehicleno) AS tab1
When I run the Query it is showing the output as
System.Byte[] instead of “Expired”
In the above query inexpire is column values
How can I solve this issue…..
Need Query Help
I think you would need to use the same datatype for both cases
e.g.
or
Edit
Actually I just did a quick test on my machine this mixing of datatypes doesn’t cause an error but the result just shows as
Blobin MySQL Workbenchstops this issue as suggested here. This should thus avoid the
Byte[]issue