|
|
|
|
|
|
-
Madhivanan Commented 1 Months ago through Blogs | 1 Point
select distinct col from table
You need to give more information if the above does not meet your requirement...
|
ani
1059
·
0% ·
24
|
|
-
Madhivanan Commented 1 Months ago through Blogs | 1 Point
riks, that will give you the correct result. However there will a warning about NULL. If you use SUM(CASE WHEN gender='M' THEN 1 ELSE 0 END), you won't get the NULL warning...
|
|
|
-
Madhivanan Commented 1 Months ago through Blogs | 1 Point
Thanks Naomi for that thread...
|
-
Madhivanan Posted 1 Months ago through Blogs | 10 Points
When viewing the existing table structures, I noticed that one table has a column with datatype defined as VARCHAR(1). I generally do not see this being used.
Given that you need to use a character datatype of maximum length of 1, the question is "Is V...
|
|
|
-
Madhivanan Posted 2 Months ago through Blogs | 10 Points
You can do conditional aggregation like SUM(CASE WHEN .. THEN 1 ELSE 0 END),....etc to find a count for a particular match. This type of conditions are useful when you want to write a CROSS-TAB/PIVOT Query. You can also make use of COUNT(CASE WHEN .. TH...
|
-
Madhivanan Commented 2 Months ago through Blogs | 1 Point
ani, you can make use of derived table
select max(sal) as sal from
(
select max(sal) as sal from table1
union
select max(sal) as sal from table2
) as t...
|