Skip to content

Tag: sql

CASE Statement in SQL

just a curious question. I have written following code using CASE statement but I don’t have data so I am not sure if my logic is correct. All I am doing is I am applying length check on each field …

SQL Query with ORDER BY

I have a table in my SQL database that looks like: id type radius ————————- 1 type1 0.25 2 type2 0.59 3 type1 0.26 4 type1 0.78 5 type3 …

MYSQL – count number of rows in each table

I would like to know how many rows are in each table in my database. I’ve come so far as to having However i would need to do that on each and every table – and there are a lot. What would me the best way to get a print-out with the table name and it’s row count? Answer I

GROUP BY – do not group NULL

I’m trying to figure out a way to return results by using the group by function. GROUP BY is working as expected, but my question is: Is it possible to have a group by ignoring the NULL field. So that it does not group NULLs together because I still need all the rows where the specified field is NULL. S…