<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Le blog de jsd03 &#187; filtrage</title>
	<atom:link href="https://blog.developpez.com/jsd03/ptag/filtrage/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.developpez.com/jsd03</link>
	<description></description>
	<lastBuildDate>Mon, 07 Nov 2016 14:34:06 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>Filtrage non égalitaire avec Oracle</title>
		<link>https://blog.developpez.com/jsd03/p11745/bdd/filtrage-non-egalitaire-avec-oracle</link>
		<comments>https://blog.developpez.com/jsd03/p11745/bdd/filtrage-non-egalitaire-avec-oracle#comments</comments>
		<pubDate>Tue, 29 Jan 2013 09:36:18 +0000</pubDate>
		<dc:creator><![CDATA[jsd03]]></dc:creator>
				<category><![CDATA[Base de données]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[filtrage]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/jsd03/?p=58</guid>
		<description><![CDATA[Ce titre d&#8217;article semble bateau au premier abord mais il me semble essentiel de parler de cette expérience pour le moins &#171;&#160;étrange&#160;&#187; avec un filtre sur j&#8217;ai effectué sur Oracle ces jours-ci. Le filtre suivant : 1WHERE maColonne != 'uneValeur' &#8230; <a href="https://blog.developpez.com/jsd03/p11745/bdd/filtrage-non-egalitaire-avec-oracle">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Ce titre d&rsquo;article semble bateau au premier abord mais il me semble essentiel de parler de cette expérience pour le moins &laquo;&nbsp;étrange&nbsp;&raquo; avec un filtre sur j&rsquo;ai effectué sur Oracle ces jours-ci.<br />
<span id="more-58"></span><br />
Le filtre suivant :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">WHERE maColonne != 'uneValeur'</div></td></tr></tbody></table></div>
<p>renvoi, contrairement à ce que j&rsquo;aurai pensé, toutes les lignes de ma table dont la colonne &laquo;&nbsp;maColonne&nbsp;&raquo; est différente de &lsquo;uneValeur&rsquo; (jusque là tout va bien) <strong>mais également</strong> les lignes où &laquo;&nbsp;maColonne&nbsp;&raquo; IS NULL !</p>
<p>Et oui il semblerait qu&rsquo;il faille rajouter</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">OR maColonne IS NOT NULL</div></td></tr></tbody></table></div>
<p>Exemple :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">SELECT *<br />
FROM<br />
(<br />
&nbsp; &nbsp; SELECT null as maColonne<br />
&nbsp; &nbsp; FROM dual<br />
&nbsp; &nbsp; &nbsp; &nbsp; UNION <br />
&nbsp; &nbsp; SELECT 'uneValeur'<br />
&nbsp; &nbsp; FROM dual<br />
&nbsp; &nbsp; &nbsp; &nbsp; UNION<br />
&nbsp; &nbsp; SELECT 'uneAutreValeur'<br />
&nbsp; &nbsp; FROM dual<br />
)<br />
where maColonne != 'uneValeur'</div></td></tr></tbody></table></div>
<p>Renvoi une seule ligne alors que</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">SELECT *<br />
FROM<br />
(<br />
&nbsp; &nbsp; SELECT null as maColonne<br />
&nbsp; &nbsp; FROM dual<br />
&nbsp; &nbsp; &nbsp; &nbsp; UNION <br />
&nbsp; &nbsp; SELECT 'uneValeur'<br />
&nbsp; &nbsp; FROM dual<br />
&nbsp; &nbsp; &nbsp; &nbsp; UNION<br />
&nbsp; &nbsp; SELECT 'uneAutreValeur'<br />
&nbsp; &nbsp; FROM dual<br />
)<br />
where (maColonne != 'uneValeur'<br />
OR maColonne IS NULL)</div></td></tr></tbody></table></div>
<p>renvoi bien deux lignes&#8230;</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
