Re: [GENERAL] Select Rows With Only One of Two Values [RESOLVED]

2012-07-20 Thread Thomas Kellerer
Chris Angelico wrote on 20.07.2012 18:25: I don't know how hard it'd be to make it work on Postgres, but here's an epic piece of SQL awesomeness: http://thedailywtf.com/Articles/Stupid-Coding-Tricks-The-TSQL-Madlebrot.aspx That has already been done - and much cleaner I think ;) https://wiki.

Re: [GENERAL] Select Rows With Only One of Two Values [RESOLVED]

2012-07-20 Thread Andreas Kretschmer
Chris Angelico wrote: > No probs! SQL, like many other languages, allows you to combine its > primitives in some fairly complex ways. I don't know how hard it'd be > to make it work on Postgres, but here's an epic piece of SQL > awesomeness: > > http://thedailywtf.com/Articles/Stupid-Coding-Tric

Re: [GENERAL] Select Rows With Only One of Two Values [RESOLVED]

2012-07-20 Thread Chris Angelico
On Sat, Jul 21, 2012 at 2:21 AM, Rich Shepard wrote: > On Sat, 21 Jul 2012, Chris Angelico wrote: > >> Try this: >> >> SELECT DISTINCT param FROM table WHERE indicator=0 >> EXCEPT >> SELECT DISTINCT param FROM table WHERE indicator=1 > > > Chris, > > Thank you. I knew it was simple, and I've not

Re: [GENERAL] Select Rows With Only One of Two Values [RESOLVED]

2012-07-20 Thread Rich Shepard
On Sat, 21 Jul 2012, Chris Angelico wrote: Try this: SELECT DISTINCT param FROM table WHERE indicator=0 EXCEPT SELECT DISTINCT param FROM table WHERE indicator=1 Chris, Thank you. I knew it was simple, and I've not before used the EXCEPT condition. Very much appreciate, Rich -- Sent vi