Select table and select by primary writing