merge with SQL