I want to implement something like Col3 = Col2 + Col1 in SQL.
This is somewhat similar to Excel, where each value in column 3 is the sum of the corresponding values ββfrom column 2 and column 1.
Yes, you can do this in SQL using the UPDATE command:
UPDATE TABLE table_name SET col3=col1+col2 WHERE <SOME CONDITION>
This assumes that you already have a table filled with col1 and col2, and you want to populate col3.
See Computed Columns
, . , , , .
CREATE TABLE J
-
CREATE TABLE dbo.mytable ( low int, high int, myavg AS (low + high)/2 ) ;
Yes. If it does not aggregate data row by row.
suppose that col1and col2are integers.
col1
col2
SELECT col1, col2, (col1 + col2) as col3 FROM mytable
Source: https://habr.com/ru/post/1736266/More articles:Using nested error wrappers with jQuery validation plugin - jqueryBandwidth Limitations - ICS Components Delphi 2007 - delphihttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1736263/access-to-an-array-items&usg=ALkJrhjS-iADwC1r55W9MUtSX02adopV-wHow to convert string format number (22.123) to float variable format without using any API in C ++ - c ++Why does return falsely stop the warning? - javascriptclassification training using libsvm - machine-learningHow to add a navigation controller programmatically? - iphoneIs Django the best solution for me, if yes, please help me - windowsBroken unicode strings encoded in UTF-8? - pythonWinforms control that works as the completion of ajax tag - c #All Articles