Re: help on SQL - Mailing list pgsql-interfaces
From | Kenneth Suralta |
---|---|
Subject | Re: help on SQL |
Date | |
Msg-id | 408627AF.2020204@hq.ntsp.nec.co.jp Whole thread Raw |
In response to | Re: help on SQL (Gergely Czuczy <phoemix@harmless.hu>) |
Responses |
Re: help on SQL
(Gergely Czuczy <phoemix@harmless.hu>)
Re: help on SQL (Michael Stephenson <mstephenson@tirin.openworld.co.uk>) |
List | pgsql-interfaces |
hi gergely,<br /><br /> thanks for replying..<br /> what i mean is supposing there is a table with the following rows:<br/><pre wrap=""><tt>data <span class="moz-txt-citetags"></span>----- 1 2 3 4 5 6 7 is it possible to get every other N-row in the table? example, if N is 3. data ----- 1 4 7 thanks, kenneth </tt></pre><br /><br /> Gergely Czuczy wrote:<br /><blockquote cite="midPine.LNX.4.44.0404210907250.28604-100000@localhost"type="cite"><pre wrap="">On Wed, 21 Apr 2004, Kenneth Suraltawrote: </pre><blockquote type="cite"><pre wrap="">hello everyone, is it possible to get every other row in the table? like for example: data ----- 1 2 3 4 5 6 7 </pre></blockquote><pre wrap="">SELECT t.fields FROM table t WHERE data NOT IN (SELECT t2.data FROM tablet2 WHERE some_whereclause); it will select these rows which ones are not in the subquery. but you can do it simply by getting the negate of the whereclause... </pre><blockquote type="cite"><pre wrap="">Is it possible to havethis result (interval of 3)? result ------ 1 4 7 </pre></blockquote><pre wrap="">i don't see what you mean. please describe it. </pre><blockquote type="cite"><pre wrap="">thanks, kenneth -- ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster </pre></blockquote><pre wrap=""> Bye, Gergely Czuczy mailto: <a class="moz-txt-link-abbreviated" href="mailto:phoemix@harmless.hu">phoemix@harmless.hu</a> PGP: <a class="moz-txt-link-freetext" href="http://phoemix.harmless.hu/phoemix.pgp">http://phoemix.harmless.hu/phoemix.pgp</a> "Wish a god, a star, to believe in, With the realm of king of fantasy..." ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to <a class="moz-txt-link-abbreviated"href="mailto:majordomo@postgresql.org">majordomo@postgresql.org</a>) </pre></blockquote><br /><div class="moz-signature">-- <br /><img border="0" src="cid:part1.02090701.07000506@hq.ntsp.nec.co.jp"/></div>
pgsql-interfaces by date: