How can I add 1 to the ms sql/column?;;

Asked 2 years ago, Updated 2 years ago, 131 views

To be exact, when you insert the LEVL1 and LEVL2 columns, you add +1 to the record value of LEVL1 I want to reflect it in LEVL2

When I saved it as Merge into, I created a query...

How can LEVL2 reflect the value added by 1 in the column LEVL1 when inserting? If it's not PK...

It's a stupid question, but I don't know;;ㅠ<

mssql

2022-09-21 11:33

1 Answers

INSERT INTO MY_TABLE (
  LEVL1,
  LEVL2
)
VALUES (
  #The value of the received REVL1 #, 
  SELECT LEVL1 + 1 FROM MY_TABLE WHERE #Inquiry conditions received #
)

I didn't understand the question, but I'm going to answer it.


2022-09-21 11:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.