ش | ی | د | س | چ | پ | ج |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
تمام برداشت ها از سایت های خارجی جهت آموزش شما دوستان مبتدی اخذشده،نایاب هستند لذا نهایت استفاده را ببرید.
We are looking to make changes
select * from products where productid in(
(select val(lastt) as lastt from (select distinct dlast('ProductId','products',"supplierId=" & [SupplierId]) as Lastt,supplierid from products
order by supplierid)))
ProductID | ProductName | SupplierID | CategoryID | Unit | Price |
---|---|---|---|---|---|
3 | Aniseed Syrup | 1 | 2 | 12 - 550 ml bottles | 10 |
8 | Northwoods Cranberry Sauce | 3 | 2 | 12 - 12 oz jars | 40 |
12 | Queso Manchego La Pastora | 5 | 4 | 10 - 500 g pkgs. | 38 |
15 | Genen Shouyu | 6 | 2 | 24 - 250 ml bottles | 15.5 |
23 | Tunnbröd | 9 | 5 | 12 - 250 g pkgs. | 9 |
24 | Guaraná Fantástica | 10 | 1 | 12 - 355 ml cans | 4.5 |
27 | Schoggi Schokolade | 11 | 3 | 100 - 100 g pieces | 43.9 |
30 | Nord-Ost Matjeshering | 13 | 8 | 10 - 200 g glasses | 25.89 |
39 | Chartreuse verte | 18 | 1 | 750 cc per bottle | 18 |
41 | Jack's New England Clam Chowder | 19 | 8 | 12 - 12 oz cans | 9.65 |
44 | Gula Malacca | 20 | 2 | 20 - 2 kg bags | 19.45 |
46 | Spegesild | 21 |
استفاده از عبارت Last
select * from products where productid in(select lLast from (select distinct last([productId]) As lLast,supplierid from products group by supplierid order by supplierid))
Or
select * from products where productid in(select distinct last([productId]) As lLast from products group by supplierid)
select * from products where productid in(select distinct last([productId])-1 As lLast from products group by supplierid)
select * from products where productid in(select distinct first([productId]) As ifirst from products group by supplierid)
first-and-lastfunction-in-ms-access