I want to create a new table from query result in SSMS:

Query result:

```
select table1.col1, table1.col2, table2.col3
from table1
inner join table2 on table1.col1 = table2.col1
order by col1 asc;

```

How can I create new table from above result:

I have tried

```
select *
into new_table
from (
    select table1.col1, table1.col2, table2.col3
    from table1
    inner join table2 on table1.col1 = table2.col1
    order by col1 asc
);

```

I got the error

> 
> Msg 102, Level 15, State 1, Line 11 Incorrect syntax near ';'.
> 
> 
> 

Thanks
['https://Stackoverflow.com/questions/65421043', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/14875495/']
Assuming you have knowledge in Redux with React.

Firstly, install these packages

`$ npm install next-redux-wrapper react-redux redux redux-thunk --save`

`$ npm install redux-devtools-extension --save-dev`

---

Override or create the default App, create the file `./pages/_app.js` as shown below:

```js
import withRedux from 'next-redux-wrapper'
import { Provider } from 'react-redux'
import { withRouter } from 'next/router'
import App from 'next/app'

import createStore from 'store/createStore'

class MyApp extends App {
  render () {
    const { Component, pageProps, router, store } = this.props
    return (
          <Provider store={store}>
              <Component router={router} {...pageProps} />
          </Provider>
    )
  }
}

export default withRedux(createStore)(
  withRouter(MyApp)
)

```

---

In your pages/component, you can use Redux as you do normally.
I would recommend using [redux toolkit](https://redux-toolkit.js.org/) because it reduces boilerplate code in redux...

With [createSlice](https://redux-toolkit.js.org/api/createSlice) you create Action and Reducer at the same time. And in case of dispatching API calls to the backend and performing suitable state mutations for pending, fulfilled and rejected API calls, [createAsyncThunk](https://redux-toolkit.js.org/api/createAsyncThunk) is the Best!

As per my personal experience, if you are asking this question just for initial learning, then your first setup that you attached as an answer is enough but for a real App, so should definitely go with Redux Toolkit.
You can check this [sandbox](https://codesandbox.io/s/nextjs-demo-gkluc) example