On Sun, Jun 5, 2011 at 5:44 PM, Jay A. Kreibich <j...@kreibi.ch> 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 contains all
> the
> > image names in one string:
> >
> > Invoice_Item_Id | Invoice_Id | Description | Image Names
> > ----------------+------------+-------------+----------------------
> > 1               |   1        | CD          | Img1, Img2, Img3
> >
> > Can I do this with SQL?
>
>   As others have pointed out, you can, but that doesn't always make it
>  a good idea.  If you're doing this just to turn around and split that
>  value back up in your application code, you might want to rethink
>  your data handling.  The data representation in the database is clear
>  and correct.  Do you really want to alter that representation,
>  smashing the image names together into a single, less clear value, just
>  for the sake of making one query, rather than two?  Or even one query,
>  but with an extra line or two of code in the parse function?
>
>  Why not just deal with values in their native, and more correct,
>  "list of images" format?
>

Jay,

There is one simple reason:  Time

This is for my evening/weekend business where time is precious, I have been
dragging my feet on the current feature simply because I could not get my
head around how best to implement it.  It dawned on me today to take this
REALLY simple and less the idea approach for the general display of the
invoice and then to allow the user to select the line and bring up a
secondary dialog to manage the list of images.  It is quick and to the
point.  Once I get this in my customers heads, I will get feedback from them
for better ideas.

The bottom line is I am trying to NOT over engineer things and let my
customers drive things.  It seems to work well, they love seeing their
feedback taken to heart and I love their input:)

For now it is a good start:)

Sam
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to