CCing to the list ( if you are new to this list, messages come from
the sender address, you have to use "reply all" ( at least in my MUA,
web gmail ) to make your replies appear in the list ).
On Thu, Aug 18, 2016 at 3:03 PM, wrote:
> Hi Francisco,
> thanks a lot. I will give it a try later
Do
On Thu, Aug 18, 2016 at 4:56 AM, wrote:
> select custid, count(vendid) as c415 from cv where vendid = 415 group by
> custid
> [...]
>
> Is there a better way (by creating an aggregate function, perhaps)
>
You may find crosstab in the tablefuncs extension to be of use.
https://www.postgres
Hello.
On 18.8.2016 10:56, haman...@t-online.de wrote:
>
> Hi,
>
> I have a table cv with custid and vendid columns. Every entry represents the
> purchase of a product
> available from a specific vendor.
> Now, for a set of "interesting" vendors, I would like to select a new table
> custid, c
On Thu, Aug 18, 2016 at 10:56 AM, wrote:
> I have a table cv with custid and vendid columns. Every entry represents the
> purchase of a product
> available from a specific vendor.
> Now, for a set of "interesting" vendors, I would like to select a new table
> custid, c415, c983, c1256
> based up
Hi,
I have a table cv with custid and vendid columns. Every entry represents the
purchase of a product
available from a specific vendor.
Now, for a set of "interesting" vendors, I would like to select a new table
custid, c415, c983, c1256
based upon part queries
select custid, count(vendid) as
...@gmail.com] On Behalf Of Chris Curvey
Sent: Saturday, October 01, 2011 10:55 PM
To: Jeff Adams
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] SQL Help - Finding Next Lowest Value of Current Row
Value
On Sat, Oct 1, 2011 at 5:30 PM, Jeff Adams wrote:
Greetings,
I have a large table (~19
Jeff Adams wrote on 01.10.2011 23:30:
Greetings,
I have a large table (~19 million records). Records contains a field
identifying a vessel and a field containing an time (epoch). Using the
current rows vessel and time values, I need to be able to find the next
lowest time value for the vessel an
On Sat, Oct 1, 2011 at 5:30 PM, Jeff Adams wrote:
> Greetings,
>
> I have a large table (~19 million records). Records contains a field
> identifying a vessel and a field containing an time (epoch). Using the
> current rows vessel and time values, I need to be able to find the next
> lowest time
On Sat, Oct 1, 2011 at 2:30 PM, Jeff Adams wrote:
> Greetings,
>
> I have a large table (~19 million records). Records contains a field
> identifying a vessel and a field containing an time (epoch). Using the
> current rows vessel and time values, I need to be able to find the next
> lowest time v
Greetings,
I have a large table (~19 million records). Records contains a field
identifying a vessel and a field containing an time (epoch). Using the
current rows vessel and time values, I need to be able to find the next
lowest time value for the vessel and use it to compute how much time has
el
On 04/29/2010 05:08 PM, Thomas Kellerer wrote:
SELECT organization, state, lastdate, age(lastdate)
FROM (
SELECT organization,
state,
(select max(idate) from times where
customers.custid=times.custid and taskid = 27) as lastdate
FROM customers
) t
order by lastdate desc
Andy Colson wrote on 29.04.2010 23:51:
Here is my query, which works:
select organization,
state,
(select max(idate) from times where customers.custid=times.custid and
taskid = 27) as lastdate,
age( (select max(idate) from times where customers.custid=times.custid
and taskid = 27) )
from custom
On 4/29/2010 4:51 PM, Andy Colson wrote:
I tried this:
select organization, state, max(idate), age(max(idate))
from customers
inner join times using(custid)
where taskid = 27
group by organization, state
order by idate desc nulls last;
but get error that times.idate must appear in group by or
Here is my query, which works:
select organization,
state,
(select max(idate) from times where customers.custid=times.custid and
taskid = 27) as lastdate,
age( (select max(idate) from times where
customers.custid=times.custid and taskid = 27) )
from customers
order by lastdate desc null
> I'm not clear how to move that "person_role.person = person.id" into
the FROM statement. Does it matter?
This should work:
FROM person
INNER JOIN person_role ON person.id = person_role.person
LEFT OUTER JOIN instructors ON (person.id = instructors.person)
LEFT OUTER JOIN class ON (instructor
On Mon, Nov 21, 2005 at 02:06:35PM -0800, Bill Moseley wrote:
> The now working query (thanks to you!) is:
No that doesn't work. It's dropping the people that have never
been assigned a class to teach (i.e. don't have a row in the
"instructors" link table).
> FROM class INNER JOIN ins
On Mon, Nov 21, 2005 at 03:25:56PM -0600, John McCawley wrote:
> I just noticed, also goofy is your ", person_role" in your from with no
> criteria. I would generally put the "person_role.person = person.id" as
> an INNER JOIN, and then only have the "person_role.role=3" in the
> where. It doe
I just noticed, also goofy is your ", person_role" in your from with no
criteria. I would generally put the "person_role.person = person.id" as
an INNER JOIN, and then only have the "person_role.role=3" in the
where. It doesn't look like that's the specific problem, but I
generally find that
It looks to me like your problem is that weird area where you alias your
inner join as "t" and thenn inner join based on this alias. You're
getting a cartesian product somewhere, as evidenced by the
"rows=700" in your explain.
I already deleted the old mail with your table structure, but tr
On Mon, Nov 21, 2005 at 11:45:34AM -0600, Bruno Wolff III wrote:
> On Mon, Nov 21, 2005 at 05:40:10 -0800,
> Bill Moseley <[EMAIL PROTECTED]> wrote:
> >
> > Here's where I'm missing something. Trying to do an outer join on
> > to bring in the class row with its class_time column:
>
> You don't
On Mon, Nov 21, 2005 at 05:40:10 -0800,
Bill Moseley <[EMAIL PROTECTED]> wrote:
>
> Here's where I'm missing something. Trying to do an outer join on
> to bring in the class row with its class_time column:
You don't say exactly why you are having a problem with this, but I think you
would be b
I need to generate a table of teachers, and the count of classes they
taught in the past and are scheduled to teach in the future.
id | last_name | totalfuture_class_count | past_class_count
-+--+--++-
3 | Smith |
LL,
>"qa_id" int8 NOT NULL,
>CONSTRAINT "user_answers_pkey" PRIMARY KEY ("ua_id")
>);
>CREATE INDEX "user_answers_qa_id_key" ON "user_answers" ("qa_id");
>CREATE INDEX "user_answers_question_id_key"
"qa_id" int8 NOT NULL,
CONSTRAINT "user_answers_pkey" PRIMARY KEY ("ua_id")
);
CREATE INDEX "user_answers_qa_id_key" ON "user_answers" ("qa_id");
CREATE INDEX "user_answers_question_id_key" ON "user_answers"
(&q
Please post the sql statement that creates these tables.
-r
At 12:15 AM 5/16/01 -0400, Alex Hochberger wrote:
>To any SQL wizards out there,
>
>I have finally exhausted my SQL knowledge.
>
>I have 3 tables that I need to do a fancy join on...
>
>1 stores the users
>1 stores the questions
>1 sto
To any SQL wizards out there,
I have finally exhausted my SQL knowledge.
I have 3 tables that I need to do a fancy join on...
1 stores the users
1 stores the questions
1 stores the user's answers to the questions (based on foreign keys to the
answers table)
I would like to create a result with
Hello, I need your help
I have three question and I need you could respond me please.
One of my questions is, how can take data that I have in Visual Basic to use
it in an sql statement like for example in the SELECT function?
The other question is, how can I execute a saved query with an sql
Hello!
I have a tabe :
addates : (adid int 4,rundate date,posted boolean,dateid int4 unique
create no. from sequence datesequence)
table is like this
adid
rundate posteddateid
1031 05-17-199
28 matches
Mail list logo