Re: [sqlite] selective result columns

2009-12-31 Thread Roger Andersson
> -Ursprungligt meddelande- > Från: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] För nomorecaddy > Skickat: den 31 december 2009 17:44 > Till: sqlite-users@sqlite.org > Ämne: Re: [sqlite] selective result columns > > > I'm

Re: [sqlite] selective result columns

2009-12-31 Thread Pavel Ivanov
> I'm operating at the user level in a java application.  The application > allows me to run an SQL query, then it renders the output into HTML. OK. Some third-party java application allows you to execute SQL query and show you result as HTML. Then you take this HTML and show it to somebody else?

Re: [sqlite] selective result columns

2009-12-31 Thread nomorecaddy
I'm operating at the user level in a java application. The application allows me to run an SQL query, then it renders the output into HTML. I want to avoid showing empty colums in the HTML output, so I wanted the include/exclude column logic in my actual SQL statement. Pavel Ivanov-2

Re: [sqlite] selective result columns

2009-12-30 Thread Pavel Ivanov
> I don't have access to that level of software, so that's the problem. You mean your experience with SQLite is based on using sqlite3 command line utility only? If so you can just redirect its output to sed which will do something like s/|\+/|/g. If your experience with SQLite is based on using

Re: [sqlite] selective result columns

2009-12-29 Thread Griggs, Donald
I'm not clear. Were you able to use Simon's syntax link: http://sqlite.awardspace.us/syntax/sqlitepg09.htm To correct your syntax? SQL works with sets, and will always return the same number of columns, but you *can* use sql to force a NULL, an empty string, or a space to be returned for a

Re: [sqlite] selective result columns

2009-12-29 Thread nomorecaddy
I don't have access to that level of software, so that's the problem. Thanks for your response - I like the power of select case, and was hoping that case could be applied in other areas as well. Simon Slavin-3 wrote: > > > On 29 Dec 2009, at 8:34pm, nomorecaddy wrote: > >> I'm looking for

Re: [sqlite] selective result columns

2009-12-29 Thread Simon Slavin
On 29 Dec 2009, at 8:34pm, nomorecaddy wrote: > I'm looking for a SQL query that returns a variable number of > columns. Many of my columns contain NULL data, and I want to avoid showing > the column altogether in that case. That is something that must be handled by your software. There is no

Re: [sqlite] selective result columns

2009-12-29 Thread nomorecaddy
Thanks, I'm looking for a SQL query that returns a variable number of columns. Many of my columns contain NULL data, and I want to avoid showing the column altogether in that case. Simon Slavin-3 wrote: > > > On 29 Dec 2009, at 6:29pm, nomorecaddy wrote: > >> Is it possible to run an SQL

Re: [sqlite] selective result columns

2009-12-29 Thread Simon Slavin
On 29 Dec 2009, at 6:29pm, nomorecaddy wrote: > Is it possible to run an SQL query in sqlite that displays columns only on a > condition? For example: > select col1, (case when 1==2 then col2) from myTable > > In this case, I only want to show one column (col1) I'm not sure I understand your

[sqlite] selective result columns

2009-12-29 Thread nomorecaddy
Is it possible to run an SQL query in sqlite that displays columns only on a condition? For example: select col1, (case when 1==2 then col2) from myTable In this case, I only want to show one column (col1) Thanks -- View this message in context: