Re: [SQL] Query to return modified results at runtime?

2006-06-07 Thread Richard Broersma Jr
> IDColor > --- --- > 1 Blue > 2 Red > 3 Green > 4 Orange > > How would I rewrite the query to return results where the colors are > replaced by letters to give the following results? > > IDColor > --- --- > 1 A > 2 D > 3 B > 4 C http://www.p

[SQL] Query to return modified results at runtime?

2006-06-07 Thread George Handin
I have a query: SELECT * FROM testtable; Where the results are: IDColor --- --- 1 Blue 2 Red 3 Green 4 Orange How would I rewrite the query to return results where the colors are replaced by letters to give the following results? IDColor --- --- 1 A 2

Re: [SQL] How To Exclude True Values

2006-06-07 Thread Richard Broersma Jr
> i think i've figured out the gist of the thought > process behind the SQL query... > > 1. select everything from t_inspect_result as table a > 2. select max timestamp value entries in > t_inspect_result as table b > 3. choose only choose those rows where the max > timestamps of table a and b are

Re: [SQL] How To Exclude True Values

2006-06-07 Thread operationsengineer1
> > Richard, > > > > i got the expected rewsults! now i just have to > study > > the query to figure out what it does. -lol- > > > > i tried using AS, but i only did it in one place - > > doh! the error message just moved to the next > place i > > didn't do it. i'll know better next time. > >

Re: [SQL] How To Exclude True Values

2006-06-07 Thread Richard Broersma Jr
> Richard, > > i got the expected rewsults! now i just have to study > the query to figure out what it does. -lol- > > i tried using AS, but i only did it in one place - > doh! the error message just moved to the next place i > didn't do it. i'll know better next time. > > thanks for the hel

Re: [SQL] How To Exclude True Values

2006-06-07 Thread operationsengineer1
> > yields the following error: > > > > ERROR: schema "a" does not exist > > > > i tried to interpret you query and apply it to my > > case, but, apparently, i didn't too good of a job. > > > > do you see the error? > > Hmmm... That is strange. but according to the > PostgreSQL documentation

Re: [SQL] How To Exclude True Values

2006-06-07 Thread Richard Broersma Jr
> yields the following error: > > ERROR: schema "a" does not exist > > i tried to interpret you query and apply it to my > case, but, apparently, i didn't too good of a job. > > do you see the error? Hmmm... That is strange. but according to the PostgreSQL documentation on select you can add

Re: [SQL] How To Exclude True Values

2006-06-07 Thread operationsengineer1
--- Richard Broersma Jr <[EMAIL PROTECTED]> wrote: > > Richard, that is the result i would need given > that > > data set. i have to digest this version, though. > > > > should this query be more efficient than the > subquery > > version as the table starts to get large? > > My experience is th

Re: [SQL] Join issue

2006-06-07 Thread operationsengineer1
> Table structures: > > ce_house > > house_id > provider_id > > ce_contract > > contract_id > house_id > contract_term > contract_created > > ce_contract_status > > contract_status_id > contract_id > contract_status > contract_status

Re: [SQL] Join issue

2006-06-07 Thread Burak Seydioglu
My current solution to the problem is PHP and it - simply put - sucks I loop through all the house records for a user using the following query SELECT * FROM ce_house LEFT JOIN ce_contract ON ce_house.house_id=ce_contract.house_id LEFT JOIN ce_contract_status

Re: [SQL] Advanced Query

2006-06-07 Thread Daryl Richter
On Jun 6, 2006, at 12:32 PM, Andrew Sullivan wrote: On Tue, Jun 06, 2006 at 09:20:13AM -0700, codeWarrior wrote: I would hope that your choice to use postgreSQL is because it is superior technology that scales well financially... not because you get a warm fuzzy from all your friends on the