Forum Discussion
Excel Visual Basics - Reading Closed .csv files & Grabbing Certain Rows
I think you can use first and last to specify the first and last records like below:
select first(item_description),first(qty) from PiecesMinifigsSets union all select last(item_description),last(qty) from PiecesMinifigsSets;
sample:
drop table PiecesMinifigsSets;
create table PiecesMinifigsSets (item_description text,qty double);
insert into PiecesMinifigsSets values('black title',0.1);
insert into PiecesMinifigsSets values('black title',0.2);
insert into PiecesMinifigsSets values('black title',0.3);
insert into PiecesMinifigsSets values('black title',null);
insert into PiecesMinifigsSets values('blue title',0.11);
select * from PiecesMinifigsSets;
item_description qty
black title | .1 |
black title | .2 |
black title | .3 |
black title | |
blue title | .11 |
select first(item_description),first(qty) from PiecesMinifigsSets union all select last(item_description),last(qty) from PiecesMinifigsSets;
Expr1000 Expr1001
black title | .1 |
blue title | .11 |
- peiyezhuAug 26, 2023Bronze ContributorThe FIRST() function is only supported in MS Access/jet engine
http://www-db.deis.unibo.it/courses/TW/DOCS/w3schools/sql/sql_func_first.asp.html