Case when col2>100 then 1 else col2 end On 26 May 2015 00:25, "Masf" <masfwo...@gmail.com> wrote:
> Hi. > > In a dataframe, How can I execution a conditional sentence in a > aggregation. For example, Can I translate this SQL statement to DataFrame?: > > SELECT name, SUM(IF table.col2 > 100 THEN 1 ELSE table.col1) > FROM table > GROUP BY name > > Thanks!!!! > -- > Regards. > Miguel >