What do you want to save?
Add Code snippet
New code examples
-
Other 2022-01-22 19:21:34
To ignore duplicate keys during 'copy from' in postgresql
create temp table tmp_table on commit drop as select * from brand with no data; copy tmp_table (name,slug) from '/var/lib/postgresql/data/Brands.csv' DELIMITER ',' csv header; insert into brand select distinct on (slug) * from tmp_table; Add solution -
PHP 2021-10-04 20:09:03
how to use union and intersection in laravel query
$queryWithParent = SaleService::query() ->select(\DB::raw('DISTINCT ON (properties.parent_id) sale_services.*')) ->from('sale_services') ->join('properties', 'sale_services.property_id', '=', 'properties.id') ->whereNotNull('pr... Add solution