[MySQL] Comparision Operators, lager dan laag

Pagina: 1
Acties:
  • 46 views sinds 30-01-2008

  • P.B.
  • Registratie: Juli 2001
  • Niet online
Niet zo'n passende titel, maar ik wist niks anders te verzinnen.
Ik zit met de volgende SQL Query:
SELECT GP_LinkExchange.ID, GP_LinkExchange.URL FROM GP_LinkExchange LEFT JOIN GP_LE_Stats ON GP_LinkExchange.ID = GP_LE_Stats.LE_ID AND GP_LE_Stats.SessionID = '$sid' WHERE GP_LE_Stats.LE_ID IS NULL AND GP_LinkExchange.HitsIn>=GP_LinkExchange.HitsOut AND IsSponsor='0' AND GP_LinkExchange.ID !='$referrerid' ORDER BY RAND() LIMIT 1
Nou zie je in het vetgedrukte stuk dat er gebruik wordt gemaakt van een comparision operator (bij een integer): '>=' --- Groter dan óf gelijk aan.

Wat ik wil is een comparision operator, of iets deregelijks, dat doet 'groter dan óf gelijk aan óf 2 minder dan.

Welke is dit ? / Hoe doe ik dit ?

n.b. http://www.mysql.com/doc/en/Comparison_Operators.html heb ik al doorgenomen.

[ Voor 10% gewijzigd door P.B. op 12-12-2002 15:04 ]


  • GeniusDex
  • Registratie: Augustus 2001
  • Laatst online: 22-06 13:24

GeniusDex

Thumbs up for insanity!

x >= y OR x = (y-2) ?

[ Voor 22% gewijzigd door GeniusDex op 12-12-2002 15:03 ]

Please guys, I'm trying to troll here.
If I failed to offend you in this post, please leave a message. I will address you in next post.


Verwijderd

(GP_LinkExchange.HitsIn>=GP_LinkExchange.HitsOut OR GP_LinkExchange.HitsIn-2=GP_LinkExchange.HitsOut)


? zo iets wat je wil? of wil je een marge van 2?

  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

Kom op, als je dat niet zelf kan bedenken, moet je misschien even een andere hobby gaan zoeken ;)

Of natuurlijk ook even nalezen over Booleaanse logica, logical operators, etc. Zo lastig is 't niet :Y)

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz


Dit topic is gesloten.