Re: [sqlite] Howto pivot in SQLite

2015-01-07 Thread kumardsingh
Follow below steps :Suppose My Table create table data ( ...> id int, ...> countryid int, ...> state varchar(30) ...> );Insert Query sqlite> INSERT INTO data VALUES(56,9,'true');sqlite> INSERT INTO data VALUES(56,54,'true');sqlite> INSERT INTO data

Re: [sqlite] Howto pivot in SQLite

2011-06-06 Thread Sam Carleton
Tom, Stop and think about what you just suggested: The invoice would look something like this: |Qty | Desc | Price | Total -++---+ +| 2 | 5x7 | 9.95 | 18.90 +| 1 | 5x7 | 9.95 | 18.90 +| 1 | 8x10 | 19.95 | 19.95 +| 2 | 16x20 | 49.00 | 98.00 +| 1 |

Re: [sqlite] Howto pivot in SQLite

2011-06-05 Thread BareFeetWare
On 06/06/2011, at 8:30 AM, Sam Carleton wrote: > allow the user to select the line and bring up a secondary dialog to manage > the list of images You could simply execute a second select when the user asks for the set of images for that invoice. It's simpler and

Re: [sqlite] Howto pivot in SQLite

2011-06-05 Thread Sam Carleton
On Sun, Jun 5, 2011 at 5:44 PM, Jay A. Kreibich wrote: > On Sun, Jun 05, 2011 at 12:47:47PM -0400, Sam Carleton scratched on the > wall: > > > In one select statement, I want to return a view of all the Invoice_Items > > for a particular Invoice such that there is one column that

Re: [sqlite] Howto pivot in SQLite

2011-06-05 Thread Jay A. Kreibich
On Sun, Jun 05, 2011 at 12:47:47PM -0400, Sam Carleton scratched on the wall: > In one select statement, I want to return a view of all the Invoice_Items > for a particular Invoice such that there is one column that contains all the > image names in one string: > > Invoice_Item_Id | Invoice_Id |

Re: [sqlite] Howto pivot in SQLite

2011-06-05 Thread Sam Carleton
On Sun, Jun 5, 2011 at 1:04 PM, Simon Slavin wrote: > > Take a look at the group_concat() function: > > http://www.sqlite.org/lang_aggfunc.html > That is PERFECT, thank you! If the person who thought of this function originally is reading this, thank you!!! What a time

Re: [sqlite] Howto pivot in SQLite

2011-06-05 Thread Simon Slavin
On 5 Jun 2011, at 5:47pm, Sam Carleton wrote: > In one select statement, I want to return a view of all the Invoice_Items > for a particular Invoice such that there is one column that contains all the > image names in one string: > > Invoice_Item_Id | Invoice_Id | Description | Image Names >