NYCPHP Meetup

NYPHP.org

[nycphp-talk] SQL question - summary data for two categories

Daniel Convissor danielc at analysisandsolutions.com
Mon Aug 2 19:18:59 EDT 2004


On Mon, Aug 02, 2004 at 07:17:46AM -0400, Michael Myers wrote:
> I have a primary data table that holds the same type of results for two 
> different categories. There is a column in the table that reflects the 
> category for each row.

Good job.


> Up to this point, I have been creating two separate summary tables, one 
> for each category. 

Ouch.  Glad you've seen the light of merging them into one table.


> Is it possible to combine them in one CREATE...SELECT construct?

Not really, that I know of.  For ease of long term maintenance, 
comprehension and accuracy in choosing column types, do your self a 
favor: make one file that just has a CREATE TABLE statement.  Don't 
have it do a create select.

Then create separate SELECT INTO statements to move the data from the 
different tables into the new centralized table.

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409



More information about the talk mailing list