Re: [sqlite] Extracting distinct category and subcategory pairs

2008-06-09 Thread flakpit


Dennis Cote wrote:
> 
> flakpit wrote:
>  
> You could try
> 
>select distinct category, subcategory
>from documents
>order by category, subcategory;
> 
> Then your application can do the display formatting, such as suppressing 
> the display of the category when it is the same as the last record.
> 

You might be right at that. I'll have a try. Thank you for the suggestion.
-- 
View this message in context: 
http://www.nabble.com/Extracting-distinct-category-and-subcategory-pairs-tp17734716p17735884.html
Sent from the SQLite mailing list archive at Nabble.com.

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


Re: [sqlite] Extracting distinct category and subcategory pairs

2008-06-09 Thread Dennis Cote
flakpit wrote:
> 
> There may be thousands of category and subcategory duplications as they are
> not the primary record identifier.
> 
> I.e. A record has a category of "Manuals" and a subcategory "Audio"
>   Another record has a category of "Manuals" and a subcategory "Phone"
>   A record has a category of "Receipts" and a subcategory "Water"
>   A record has a category of "Receipts" and a subcategory "Gas"
>   A record has a category of "Receipts" and a subcategory "Electricityr"
> 
> So they would look like:
> 
> Manuals
>   + Audio
>   + Phone
> Receipts
>  + Water
>  + Gas
>  + Electricity
> 

You could try

   select distinct category, subcategory
   from documents
   order by category, subcategory;

Then your application can do the display formatting, such as suppressing 
the display of the category when it is the same as the last record.

HTH
Dennis Cote
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Extracting distinct category and subcategory pairs

2008-06-09 Thread Simon Davies
Hi Gary,

Does

SELECT DISTINCT category, subcategory from documents;

not provide what you want? If not you may need to be more specific.

Rgds,
Simon
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users