Похожие чаты

Hi, I need help in EF Core, I have a table

tabl1 with columns
col_a | col_b
a | 1
a | 2
b | 3
b | 4
I want to select only the first row of every letter, so I get:
a | 1
b | 3
How can I achieve this?

3 ответов

5 просмотров
Adnan-Al_Beda Автор вопроса

I can do it with GroupBy, but it might be not the most efficient way, so I'm looking if there's more efficient way.

Adnan-Al_Beda Автор вопроса
luca flan di vedure
did you benchmark it?

No, but my guess is that it will have to run through all rows to then select first of each. That's how it works at least in group by: ctx.Table1.GroupBy(x => x.ColA).Select(x => x.First())

Похожие вопросы

Обсуждают сегодня

А кто-то пробовал, уезжая из Эстонии получить э-рез и продолжить вести предпринимательскую деятельность внутри Эстонии, используя свой OÜ?
Lalalashechki Lalala
62
@MrMiscipitlick А можешь макрос написать, который будет вычислять смещение относительно переданных меток? Просто .label1-.label2, и вернуть значение.
КТ315
35
Чем оно проблема?
Nikita Uzumaki
21
Hi, I was reading this https://twitter.com/HouseofChimera/status/1778078991762780408 about Verasity and their likely choice of Tron as blockchain for their token for its low f...
Jordi
13
я не магистр хаскеля, но разве не может лейзи тип конвертнуться в не-лейзи запросив вычисление содержимого прям при инициализации?
deadgnom32 λ madao
100
@samkazemian - couple questions: Update on frxBTC? - This would do well with the current influx of institutional investment entering the space Update on future veFXS streams...
Costi
16
А еще в перле можно уже @arr1 + @arr2?
Sergei Zhmylove
53
Подобного рода ;Следующие три строки это директивы ассемблера, ;которые можно не задавать, т.к.работаем в Visual Studio. ;Символ ";" - это начало однострочного комментария ...
Егор Анелькин
3
Does anyone here have a connection Mullvad? it would be nice to know what it would take to have them accept BCH 0-conf.
tl121x
16
I arrived here after a Chico Crypto show highlighted the project & the Team - the fact that the Team had a long history of successfully working with household names gave me e...
Banter is Bullish
5
Карта сайта