[Solved] How do display top 5 products from specific category [closed]

First, let’s define what we need. We need a table (view) with these fields: ProductId, ProductName, ProductViewCount, and RootCategoryId. Imagine, the Category table has RootCategoryId field already. Then we can use this query to receive the result: SELECT P.Id AS ‘ProductId’, P.Name AS ‘ProductName’, PVC.ProductViewCount, C.RootCategoryId FROM Category C INNER JOIN ProductCategory PC ON PC.CategoryId … Read more

[Solved] Python deduce best number among list of lists [closed]

Here is a function that works fine for all cases and return the list of all first candidates encountered if no choice can be made to separate them. def find_best(list_of_lists): i = 0 while len(list_of_lists[i]) == 0: i+=1 list_containing_candidates = list_of_lists[i][:] if len(list_containing_candidates) == 1 : return list_containing_candidates[0] else: if i+1 < len(list_of_lists): for next_list … Read more

[Solved] Select menu CSS [closed]

Is this what you need? select { border: 0 none; color: black; background: transparent; font-size: 14px; padding: 6px; width: 100%; background: #58B14C; text-indent: 50%; } #mainselection { overflow: hidden; width: 100%; background: #4CAF50; text-align: center; } select:hover { text-shadow: 1px 1px red; box-shadow:1px 1px red; } <div id=”mainselection”> <select> <option>Select options</option> <option>1</option> <option>2</option> </select> </div> … Read more

[Solved] select id by the min and max (sql) [closed]

You can use the MAX() and MIN() function to get the ids having largest and the id having smallest discount. Select id,discount from customer where discount=(select MAX(discount) from customer) OR discount=(select MIN(discount) from customer); 3 solved select id by the min and max (sql) [closed]

[Solved] Convert nvarchar(255) to date SQL

You can take advantage of SQL Server’s flexibility to recognize various date formats. If you have the right regional settings, this should just work: cast(mycol as date) This gives you back a value of date datetype that corresponds to the input string; Demo on DB Fiddle: select cast(‘Jan 18 2019 12:00AM’ as date) | (No … Read more

[Solved] sql get query to get any student records who have passed multiple certificates? [closed]

SELECT * FROM student_certificates GROUP BY student_id HAVING COUNT([DISTINCT] certificate_id) >= 20 Join students table if some columns from it needed (do not forget to expand GROUP BY expression accordingly). 1 solved sql get query to get any student records who have passed multiple certificates? [closed]