Aller au contenu
View in the app

A better way to browse. Learn more.

Next

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[SQL] Equivalent de LIMIT et OFFSET

Featured Replies

Posté(e)

Salut à tous, c'est encore et toujours moi :ouioui:

J'ai cherché désespérément l'équivalent de LIMIT et OFFSET pour SQL Server 2005.

Malheureusement, je n'ai pas trouvé. Par contre j'ai trouvé le code d'une personne qui a contourné le problème. Je l'ai adapté pour ma DB et j'ai ceci:

SELECT Name
FROM (SELECT TOP 2 Name
	   FROM (SELECT TOP 5 Name
				 FROM Folder
				 ORDER BY Name) AS aaa
	   ORDER BY Name DESC) AS bbb
ORDER BY Name

Ca marche bien quand je fais tourner. En fait ca me renvoit 2 résultats en démarrant du 5ieme, je veux utiliser ca pour faire un système de pagination.

Bon le soucis, c'est que le 2 et le 5 je voudrais le passer en paramètre mais il ne veut pas :(

J'ai mis:

SELECT	 Name
FROM		 (SELECT	 TOP @ProcedureLimit Name
				   FROM		  (SELECT	 TOP @ProcedureOffSet Name
										   FROM		  Folder
										   ORDER BY Name) AS foo
				   ORDER BY Name DESC) AS bar
ORDER BY Name

en prenant soin de déclarer ces variables comme suit:

@ProcedureLimit INT,
@ProcedureOffSet INT

Mais j'ai un message d'erreur :( Il ne veut pas de mes paramètres :(

une petite idée ???

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.