Answer the question
In order to leave comments, you need to log in
Why doesn't max-width="100%" work in the section description on the site (Bitrix)?
There are pictures in the text descriptions on the site. On mobile devices, they go off the screen, so I set the properties max-width="100%"; height="auto". And it works, but only on product pages. For some reason it's not on the page. What could be the problem? Or are there other ways to optimize images for mobile. devices?
An example of a page where properties work successfully is https://di-zel.ru/equipment/post_zapravki_konditsi...
An example of a page where max-width does not help is https://di-zel.ru/equipment/aircon/ (in description at the bottom of the page)
Answer the question
In order to leave comments, you need to log in
select name, MAX(price) from products
GROUP BY name
select name, MAX(id) from products
GROUP BY name
Wrote you a test piece using RANK for your purposes
CREATE TABLE #products (
id int,
name nvarchar(255),
price money
)
insert into #products
(
id,
name,
price
)
values
(0,'пиво',100),(1,'водка',200),(2,'пиво',150),(3,'пиво',100),(4,'спирт',1000)
SELECT
id,
name,
price
FROM (
SELECT id
,NAME
,price
,RANK() OVER (PARTITION BY NAME ORDER BY ID DESC) RNK
FROM #products ) X
where X.RNK=1
The standard straight-forward solution would be the following query:
SELECT t.name, (SELECT p.price FROM products p WHERE p.id = t.max_id) AS last_price
FROM (SELECT name, max(id) AS max_id FROM products GROUP BY name) t
An example of a page where properties work successfullyDoes not work.
properties max-width="100%";Firstly, this is not a "property" for you, but an attribute, and secondly, it does not work because such an attribute does not exist in the specification, if you want to set the maximum width, you need to use styles (and there it will still be a property).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question