RES: [SQL] Left join?

2006-07-02 Thread Carlos H. Reimer
It´s just want I need! Perfect! Thanks! Carlos -Mensagem original- De: Richard Broersma Jr [mailto:[EMAIL PROTECTED] Enviada em: sábado, 1 de julho de 2006 18:45 Para: [EMAIL PROTECTED]; pgsql-sql@postgresql.org Assunto: Re: [SQL] Left join? In the following table, codsol,

Re: [SQL] Alternative to Select in table check constraint

2006-07-02 Thread Richard Broersma Jr
On Fri, 2006-06-30 at 18:41 -0700, Richard Broersma Jr wrote: CHECK ( 1 = ALL ( SELECT COUNT(STATUS) FROM BADGES WHERE STATUS = 'A' GROUP BY EMPNO)) From the

Re: [SQL] Alternative to Select in table check constraint

2006-07-02 Thread Richard Broersma Jr
This is more of an implementation option, but when I worry about what is active/inactive I put start/end dates on the tables. Then you don't need active indicators. You just look for the record where now() is = start date and now() = end date or end date is null. You can even

[SQL] join two tables with sharing some columns between two

2006-07-02 Thread filippo
Hi, I have two tables like these: (this is an example, the actual tables have diffferent fields and meanings) TABLE1 id person_name date_arrival date_departure TABLE2 id car_description date_arrival date_departure I'd like to make a query to have such resulting table RESULTING_TABLE id

[SQL] graph plottin engines compatible with postgres

2006-07-02 Thread Parang Saraf
hey,I wanted to know about graph plotting engine that is compatible with postgres 8.1.4. I am performing some queries like :Comparing the speed of three runners namely A, B and C versus time. I want to publish the result in a graphical manner on the net instead of just providing the data. So, if

[SQL] unique values of profile in the whole system

2006-07-02 Thread deb . vanni
Hi all, I have a problem to solve and I don't have a long experience with database, please help me!!! We are developing a system for profile management. The simplified schema is composed by three tables: * tbl_user : the users table; contains the unique id of the users and the profile

[SQL] SQL (Venn diagram type of logic)

2006-07-02 Thread Vinnie Ma
Hello everyone. I have a customer purchase table that keeps track of transaction details. I'm looking sum up total spent by each customer and classify each customer based on which products they bought. Data looks like... account_id, date, product_id, sale_price

[SQL] Can't drop table

2006-07-02 Thread Hima Surapaneni
Hi, I have created a table called experimenters with the following query: CREATE TABLE experimenters ( experimenter_id INTEGER CONSTRAINT firstkey PRIMARY KEY, first_name CHAR(20), last_nameCHAR(25), address CHAR(30), phone_num

Re: [SQL] join two tables with sharing some columns between two

2006-07-02 Thread Phillip Smith
If I understand correctly... I think this should work: SELECT table1.id, table1.person_name, table2.car_description, table1.date_arrival, table1.date_departure FROMtable1, table2 WHERE table1.id = table2.id ; Assuming the

Re: [SQL] Can't drop table

2006-07-02 Thread Richard Broersma Jr
I have created a table called experimenters with the following query: CREATE TABLE experimenters ( experimenter_id INTEGER CONSTRAINT firstkey PRIMARY KEY, first_name CHAR(20), last_nameCHAR(25), address CHAR(30), phone_num

Re: [SQL] Can't drop table

2006-07-02 Thread Tom Lane
Hima Surapaneni [EMAIL PROTECTED] writes: The query was successful. But when I try to drop or alter the table, it just hangs without echoing any error message. I have to cancel the query to get out. Sounds like there's some open transaction with a lock on the table. The pg_locks view might