I am working on a SQL query to update a column values with an Id from a different table 

Example

```
Organization Table
Id Name
1  AA
2  BB

Events Table
Id Name OrgId
1  AA    NULL
2  AA    NULL
3  BB    NULL 

```

Now, I would like to update OrgId of Events table with its respective Id from Organization table

I did try the below query but I had explicitly do it for each organization

```
UPDATE Event SET OrId=
  (SELECT DISTINCT O.ID FROM Organization O WHERE O.Name='AA') WHERE Name='AA'

```

**May I know a better way to do it automatically?**