SELECT calldate,
src,
dst,
dcontext,
channel,
dstchannel,
lastapp,
lastdata,
duration,
billsec,
MIN(uniqueid) as uniqueid1,
amaflags,
accountcode,
userfield
FROM cdr WHERE src='81113331110'
GROUP BY calldate,
src,
dst,
dcontext,
channel,
dstchannel,
lastapp,
lastdata,
duration,
billsec,
amaflags,
accountcode,
userfield
ORDER BY (MIN(uniqueid)) DESC
ref:
<tr v-for="row in data2" class="row body">
<td>
<button
ref="myButton"
class="checkbox"
@click="clrRow">x</button>
<input type="text" v-model="row.wednesday_from">
<input type="text" v-model="row.wednesday_to">
</td>
</tr>
console.log(this.$refs.myButton.$parent.$children)
with rec as (
select "recordId" as rec_id
from catalog_49_links
where "catalogId" = 36 and "catalogRecordId" = 352
order by "createdAt" desc
limit 1
)
select "recordId" as new_rec_id from catalog_49_links where "recordId" in (select rec_id from rec) and "catalogId" = 56 or ("catalogId" = 36 and "catalogRecordId" = 352) order by "createdAt" desc limit 1;
with rec as (
select "recordId" as rec_id
from catalog_49_links
where "catalogId" = 36 and "catalogRecordId" = 352
order by "createdAt" desc
limit 1
)
select "recordId" as new_rec_id
from catalog_49_links
join rec on rec.rec_id = catalog_49_links."recordId"
where "catalogId" = 56 or ("catalogId" = 36 and "catalogRecordId" = 352)
order by "createdAt" desc limit 1;
CREATE INDEX addr_lower_idx
ON public.addr
USING btree
(lower(factaddr) COLLATE pg_catalog."default" text_pattern_ops);
explain analyze
select * from addr
where lower(factaddr) like lower('Моск%');
Bitmap Heap Scan on addr (cost=22.40..490.53 rows=194 width=150) (actual time=0.110..0.110 rows=0 loops=1)
Filter: (lower(factaddr) ~~ 'моск%'::text)
-> Bitmap Index Scan on addr_lower_idx (cost=0.00..22.36 rows=194 width=0) (actual time=0.108..0.108 rows=0 loops=1)
Index Cond: ((lower(factaddr) ~>=~ 'моск'::text) AND (lower(factaddr) ~<~ 'мосл'::text))
Planning time: 0.174 ms
Execution time: 0.173 ms