Skip to content

Select values

Dmitry Romanov edited this page Dec 11, 2017 · 16 revisions

TL; DR;

Fastest way to select values in 3 lines:

# import RCDB
from rcdb.provider import RCDBProvider

# connect to DB
db = RCDBProvider("mysql://[email protected]/rcdb")

# select values with query
table = db.select_values(['polarization_angle','beam_current'], "@is_production", run_min=30000, run_max=30050)

table will contain 3 columns run_number, polarization_angle, beam_current. Like:

[[30044,  -1.0,  UNKNOWN],
 [30045,  45.0,  PARA   ],
...] 

More info about select runs && get values