Possible would be a subselect inside the select (although a bit slow as all subselects are):
select id, mgr_id, sal, (select max(sal) from mytable n2
where n2.mgr_id = mytable.mgr_id) as max_sal from mytable
More Related Contents:
- How to extrapolate dates in SQL Server to calculate the daily counts?
- Insert results of a stored procedure into a temporary table
- Best approach to remove time part of datetime in SQL Server
- Difference between JOIN and INNER JOIN
- Is there a way to access the “previous row” value in a SELECT statement?
- Remove Identity from a column in a table
- How to create multiple one to one’s
- efficient way to implement paging
- SQL Server – transactions roll back on error?
- Formatting Numbers by padding with leading zeros in SQL Server
- Difference between a User and a Login in SQL Server
- Convert Comma Separated column value to rows
- SQL Server : dynamic pivot over 5 columns
- For Nvarchar(Max) I am only getting 4000 characters in TSQL?
- Postgres Case Sensitivity
- How do I query for all dates greater than a certain date in SQL Server?
- Check If the string contains accented characters in SQL?
- Count based on condition in SQL Server
- What does sp_reset_connection do?
- Syntax of for-loop in SQL Server
- Replace first occurrence of substring in a string in SQL
- Why does ISNUMERIC(‘.’) return 1?
- How to correctly insert newline in nvarchar [duplicate]
- How do you copy a record in a SQL table but swap out the unique id of the new row?
- Using IF ELSE statement based on Count to execute different Insert statements
- How do I change db schema to dbo
- Is there a severe performance hit for using Foreign Keys in SQL Server?
- Sql Server : How to use an aggregate function like MAX in a WHERE clause
- Date serial in SQL?
- How to insert into a table with just one IDENTITY column?