On Sun, Mar 1, 2009 at 11:14 AM, Mike Yenco <m...@yenco.com> wrote:
> Ok, I guess this list doesn't support image attachments.  Let's see if
> I can sort of illustrate what I'm looking to do in text without
> requiring 1000 words.
>
> Table A
> blank | Group 1 | Code 1
> blank | Group 2 | Code 2
> blank | Group 3 | Code 3
>
> Table B
> Item 1 | Code 1
> Item 2 | Code 1
> Item 3 | Code 1
> Item 4 | Code 2
> Item 5 | Code 2
> Item 6 | Code 3
> Item 7 | Code 3
> Item 8 | Code 3
> Item 9 | Code 3
>
>
> Looking for a way to get a result something like below where a search
> of Table B for items containing some particular text will return the
> data in a format like this:
>
> Group 1
> blank | Item 2 | Code 1
> blank | Item 3 | Code 1
> Group 3
> blank | Item 7 | Code 3
> blank | Item 9 | Code 3
>

First, you have to understand that a SQL query returns a "rectangular"
set, that is, rows by columns. The above is "presentational," that is,
for display purposes, and you have to do that in your application. The
best you could hope for is something like

Group 1|blank    |blank
blank    | Item 2 | Code 1
blank    | Item 3 | Code 1
Group 3|blank    |blank
blank    | Item 7 | Code 3
blank    | Item 9 | Code 3

All that said, the above still doesn't make sense. What happened to

blank  |Item 1 | Code 1

or

blank   |Item 8 | Code 3

or the entire Group 2?


>
> -Mike
>
>
> On Mar 1, 2009, at 11:57 AM, Mike Yenco wrote:
>
>> Is there a way that SQLite can return all matching items to a search
>> string in Table B, but return a group name from Table A before each
>> set of matching items within the result? (see attached image).
>>
>>
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Puneet Kishor http://www.punkish.org/
Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/
Carbon Model http://carbonmodel.org/
Open Source Geospatial Foundation http://www.osgeo.org/
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to