I've been playing with this method for a while and it's not doing it. It always returns all of the columns in the case statment (even without the else). Seemed like a good solution at first, but nope.
Ah well. It was a fighting try it were. -Patti ----- Original Message ----- > You'd also need an AS after the END for each column ... and I'm not sure > what happens when the column is not null, but I suspect it would return NULL > unless there's an ELSE clause in which case you'd be saying CASE WHEN col1 > is null THEN col1 ELSE col1 END which ends up being the same thing as SELECT > * FROM mytable... > > S. Isaac Dealey > Certified Advanced ColdFusion 5 Developer > > www.turnkey.to > 954-776-0046 > ----- Original Message ----- > > interesting..... > > > -Patti > > ----- Original Message ----- > > >> You can try this, I'm not sure wif this will work if col1 is null for > > record > >> 1, and has a value for record 2 but you can give it a try: > >> > >> > >> SELECT > >> CASE WHEN col1 is Null THEN col1 END, > >> CASE WHEN col2 is Null THEN col2 END, > >> CASE WHEN col3 is Null THEN col3 END, > >> CASE WHEN col4 is Null THEN col4 END, > >> FROM mytable > >> > >> - j ______________________________________________________________________ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

