Skip to content

Jean-Pierre Lambelet

Il n'y a pas de questions bêtes

  • Programming tips
  • General tips
  • About
  • EN
    • FR
    • EN

325

SQL – How to retrieve entries before and after an ID

April 29, 2026October 21, 2013 by Jean-Pierre Lambelet
MacBook avec code sur un bureau

It is possible, for example in the context of a competition, that we are looking to find out what are the 5 best scores preceding the one I just made. To do it in SQL, although a little tricky, it is not too complicated. The 5 before me Select FROM scores WHERE score from api_scores … Read more

Categories 325 Leave a comment

SQL – how to change the ORDER BY in a query

April 29, 2026August 13, 2013 by Jean-Pierre Lambelet
MacBook avec code sur un bureau

When it is necessary to have a predefined order in a query, it is possible to change the order of the items by using a CASE in the ORDER BY. In this example id 12 must appear before id 2. Select FROM channel ORDER BY ( Box WHEN id – 1 THEN 1 WHEN id … Read more

Categories 325 Leave a comment

CSS – Making an attribute of one class more important than another

April 30, 2026August 13, 2013 by Jean-Pierre Lambelet
MacBook avec code sur un bureau

In order for one CSS attribute to take precedence over another, for example when an item is defined by two classes, it is possible to use the !important option. For example: CSS: . style1 background-color: #38c8ff; } . style2 background-color: #ffffff!important; } The background will ultimately be white

Categories 325 Leave a comment

À propos

Jean-Pierre Lambelet est un développeur web suisse. Ce blog rassemble ses astuces et tutoriels sur PHP, Symfony, Drupal, Docker et l'outillage de développement front-end.

Recent Posts

  • LLM – System prompt – Prevent contact hallucination with a registry
  • PostgreSQL – How to filter on a column with uppercase letters in its name
  • Symfony – Doctrine – How to see where a sql query is executed
  • Install drupal/console on drupal 9
  • PHP Spaceship Operator <=>
  • FR
  • EN

Recent Posts

  • LLM – System prompt – Prevent contact hallucination with a registry
  • PostgreSQL – How to filter on a column with uppercase letters in its name
  • Symfony – Doctrine – How to see where a sql query is executed
© 2026 Jean-Pierre Lambelet • RSS feed