วันพุธที่ 4 กรกฎาคม พ.ศ. 2555

PostgreSQL - การแยก string จากตัวแยก

split_part(string text, delimiter text, field int)
text
Split string on delimiter and return the given field (counting from one)
split_part('abc~@~def~@~ghi', '~@~', 2)
def

update house set p1=split_part(ident, '-', 1),p2=split_part(ident, '-', 2),p3=split_part(ident, '-', 3)

ไม่มีความคิดเห็น:

แสดงความคิดเห็น