Re: [SQLQueriesNoCode] Aggegate function and groupby question.
- On Wed, Feb 29, 2012 at 4:20 AM, sapana <sapana_de@...> wrote:
> **Insert Into tableNameA ([FieldName1],[FieldName2])
> I am new to this group and SQL as well... so I am trying out basic
> commands..I have few questions if someone can answer them.
> 1. Can we Insert multiple rows in one query without using select command ?
> I want to insert multiple rows in one query.
Select [FieldName1b],[FieldName2b] from TableNameB
>TOP 1 and ORDER BY DESC will get your group query to one maximum answer
> 2. I wanted to get Name and max salary in one query.
> select Max(salary) from employees will give me max salary
> select Name, Max(salary) from employees groupby name : gives me names of
> all employees with their max salary... I am not sure what column name to
> groupby to get one single name with max salary.
[Non-text portions of this message have been removed]