-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from MolSSI/move-std
update for moving std to own column
- Loading branch information
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
ALTER TABLE xtb_data | ||
ADD COLUMN std DOUBLE PRECISION; | ||
|
||
UPDATE xtb_data | ||
SET std = x.boltzmann_average | ||
FROM ( | ||
SELECT | ||
SUBSTRING(property FROM 1 FOR POSITION('_std' IN property) - 1) AS property_name, | ||
boltzmann_average | ||
FROM xtb_data | ||
WHERE property LIKE '%_std%' | ||
) AS x | ||
WHERE xtb_data.property = x.property_name; | ||
|
||
DELETE FROM xtb_data | ||
WHERE property LIKE '%_std%'; | ||
|
||
--------------------------------------------- | ||
ALTER TABLE xtb_ni_data | ||
ADD COLUMN std DOUBLE PRECISION; | ||
|
||
UPDATE xtb_ni_data | ||
SET std = x.boltzmann_average | ||
FROM ( | ||
SELECT | ||
SUBSTRING(property FROM 1 FOR POSITION('_std' IN property) - 1) AS property_name, | ||
boltzmann_average | ||
FROM xtb_ni_data | ||
WHERE property LIKE '%_std%' | ||
) AS x | ||
WHERE xtb_ni_data.property = x.property_name; | ||
|
||
DELETE FROM xtb_ni_data | ||
WHERE property LIKE '%_std%'; |