I have a temporary table with columnszone_name, nodeid, nodelabel,
nodegainedservice, nodelostserviceZone1, 3, Windows-SRV1, "2012-11-27
13:10:30+08", "2012-11-27 13:00:40+08"Zone1, 5, Windows-SRV2,
"2012-12-20 13:10:30+08", "2012-12-18 13:00:40+08"Many zones
and many no
On Jan 17, 2012, at 8:35, Andreas Kretschmer wrote:
> Alok Thakur wrote:
>
>> Dear,
>>
>> I am trying to provide you as much details as possible.
>>
>> answer` (
>> `id` int(10) NOT NULL AUTO_INCREMENT,
>> `question_id` int(10) NOT NULL,
>> `user_id` int(10) NOT NULL,
>> `answer` int(10)
Alok Thakur wrote:
> Dear,
>
> I am trying to provide you as much details as possible.
>
> answer` (
> `id` int(10) NOT NULL AUTO_INCREMENT,
> `question_id` int(10) NOT NULL,
> `user_id` int(10) NOT NULL,
> `answer` int(10) NOT NULL, ->
> `status` tinyint(1) NOT NULL, --> Status wil
FROM
> UserTable INNER JOIN result ON UserTable.id = result.user_id
>
> Sent from my Windows Phone
> From: Alok Thakur
> Sent: 15/01/2012 22:08
> To: pgsql-...@postgresql.org
> Subject: [SQL] sql query problem
> Dear All,
>
> I have two tables one contains details of user an
result.user_id
Sent from my Windows Phone
From: Alok Thakur
Sent: 15/01/2012 22:08
To: pgsql-sql@postgresql.org
Subject: [SQL] sql query problem
Dear All,
I have two tables one contains details of user and other contains
result. The details are:
1. UserTable - id, name, phone
2. result - id,
What does a 0 state mean? Failed? And a 1 state? Passed?
Best,
Oliveiros
2012/1/14 Alok Thakur
> Dear All,
>
> I have two tables one contains details of user and other contains
> result. The details are:
> 1. UserTable - id, name, phone
> 2. result - id, question_id, user_id, status (0 or 1)
>
Dear All,
I have two tables one contains details of user and other contains
result. The details are:
1. UserTable - id, name, phone
2. result - id, question_id, user_id, status (0 or 1)
I want the list like this:
User Id Name Attended Failed Passed
but i could not find the way to do this
Let's take the following EXPLAIN results:
ticker=# explain select * from post, forum where forum.name = post.forum
and invisible <> 1 and to_tsvector('english', message) @@
to_tsquery('violence') order by modified desc limit
100;
Dear Shane,
Thanks for the reply and your observation about the
word i have used. It is idle odometer reading.
The actual Scenario is that the vehicle is taken by
the driver.
When he comes the next day. He is suppose to login
again.
Here i am trying to find out how much distance has the
vehic
Trilok Kumar wrote:
Hi All,
I have a table called
vehicle_duty_cycle_summary
vehicle_master_id | starting_odometer |
ending_odometer | login_time |
logout_time
---+---+-++---
Hi All,
I have a table called
vehicle_duty_cycle_summary
vehicle_master_id | starting_odometer |
ending_odometer | login_time |
logout_time
---+---+-++
4 |
Iuri Sampaio wrote:
Hi all,
I created a script to install postgresql. One of the steps is to run a sql
query.
the problem is that i need to run the query as postgres user, plus it needs
to be at psql shell prompt command line, i.e:
Why does it need to be at the psql prompt?
I expected somet
Hi all,
I created a script to install postgresql. One of the steps is to run a sql
query.
the problem is that i need to run the query as postgres user, plus it needs
to be at psql shell prompt command line, i.e:
# from your shell prompt enter:
$ psql
# From the psql prompt enter the follow plp
On Sep 21, 12:09 am, [EMAIL PROTECTED] wrote:
> Write the query (or queries if necessary) needed to count the number
> of employees in each employee's department who are paid more than
> their manager.
SELECT e.dept, COALESCE (SUM (1), 0) AS n
FROM employees e JOIN employees m
ON (e
RPK wrote:
select PaySlipDate,EmpID,
case ADCode when 'GPF' then ADAmount else 0 end GPF,
case ADCode when 'GPF.ADV' then ADAmount else 0 end 'GPF.ADV'
from EmpSalaryRecord
It is showing like this:
Date EmpID GPFGPF.ADV
-
01-Jul-07 101
I have a table with records like this:
Date EmpIDADCode ADAmount
-
01-Jul-07101 GPF150
01-Jul-07102 GPF.ADV100
01-Jul-07103 GPF200
01-jul-07104
Hello...
I am trying to validate a asset number (10 Characters) from one table
to another table. Problem is they are in two different DB's and
haven't done that before?
Basically trying to take record 1 from Table 1/DB1 and validate it
against record 1 in Table 2/DB2 if the record doesn't exist i
I'm working on something similar at the moment. Don't know about you, but I
have an additional problem: I have to deal with rather large datasets (>2
recs per query) to be moved between the two databases (Oracle and PostgreSQL in
my case). After doing lots of performance test, for me the con
On May 15, 8:17 am, Paul251 <[EMAIL PROTECTED]> wrote:
> Hello...
>
> I am trying to validate a asset number (10 Characters) from one table
> to another table. Problem is they are in two different DB's and
> haven't done that before?
>
> Basically trying to take record 1 from Table 1/DB1 and valida
On Fri, Mar 24, 2006 at 02:29:10PM -0800, Stephan Szabo wrote:
>
> On Fri, 24 Mar 2006, Julie Robinson wrote:
>
> > This works, but is there a better solution?
> >
> > select *
> > from quality_control_reset T
> > where date = (
> > select max(date)
> > from quality_control_reset
> >
On Fri, 24 Mar 2006, Julie Robinson wrote:
> This works, but is there a better solution?
>
> select *
> from quality_control_reset T
> where date = (
> select max(date)
> from quality_control_reset
> where qualitycontrolrange = T.qualitycontrolrange);
If you can use PostgreSQL extens
This works, but is there a better solution?
select *
from quality_control_reset T
where date = (
select max(date)
from quality_control_reset
where qualitycontrolrange = T.qualitycontrolrange);
Julie Robinson wrote:
Given the two tables at the bottom of this email, I'm having trouble
c
Given the two tables at the bottom of this email, I'm having trouble
coming up with a SQL statement that returns all rows in the
quality_control_reset table where there is only one row for the most
recent quality_control_range. Help?
Example:
In table quality_control_reset:
id | timesta
Hi Gang,
I'm trying to optimize a query:
This query below returns something like this:
event_id | eu_tid | event_name | event_when | day | mon |
start | end|event_users |
contact_phone| contact_pager | num_opps
--++-
Thanks for the reply at least that explains it.
Nick
-Original Message-
From: Richard Huxton [mailto:[EMAIL PROTECTED]
Sent: 30 June 2005 12:22
To: Nick Stone
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] SQL Query question
Nick Stone wrote:
> Hi
>
> Whilst I'm not n
Nick Stone wrote:
Hi
Whilst I'm not new to SQL I am reasonably new to Postgres and as such I have
a question on the following query:
FROM
"Terms" As tbl1 LEFT JOIN
"SearchStore" As tbl2 ON tbl1."KeywordID" = tbl2."KeywordID" AND
tbl2."StockID" = 1
Why does the above query work fine an
Am Donnerstag, 30. Juni 2005 11:27 schrieb Nick Stone:
> SELECT
> tbl1."TermTypeID",
> tbl1."ParentID",
> tbl1."KeywordID",
> tbl1."Term",
> tbl2."KeywordID"
> FROM
> "Terms" As tbl1 LEFT JOIN
> "SearchStore" As tbl2 ON tbl1."KeywordID" = tbl2."KeywordID"
> WHERE
> (
Hi
Whilst I'm not new to SQL I am reasonably new to Postgres and as such I have
a question on the following query:
SELECT
tbl1."TermTypeID",
tbl1."ParentID",
tbl1."KeywordID",
tbl1."Term",
tbl2."KeywordID"
FROM
"Terms" As tbl1 LEFT JOIN
"SearchStore" As tbl2 ON tbl1."K
On Mon, Mar 07, 2005 at 04:22:15PM -, John McGough wrote:
> +---+---++-+--+
> | ID | JobID | UserID | Finished | Comment |
> +---+---++-+--+
This table output doesn't look like PostgreSQL's usual format.
> but I keep getting MySQL err
John McGough wrote:
SELECT Count(*) FROM Work WHERE (UserID='user1' AND MAX(Finished)=0)
Work:-
+---+---++-+--+
| ID | JobID | UserID | Finished | Comment |
+---+---++-+--+
| 1 | 1| user1 | 0 | ...|
| 2
SELECT Count(*) FROM Work WHERE (UserID='user1' AND MAX(Finished)=0)
Work:-
+---+---++-+--+
| ID | JobID | UserID | Finished | Comment |
+---+---++-+--+
| 1 | 1| user1 | 0 | ...|
| 2 | 1|
Hi PFC
Thanks for this! It has sped up complete - now in fact there is no delay!
A few tweaks had to be made to the code ; here it is:
select breakdown.alignment, sum(cnt) as num FROM
( (select alignment.name as class, count(1) as cnt
from weapons,
alignment
where weapons
If I understand well a person has all the free weapons which have a level
<= to his own level, and of course all the weapons he bought.
1) get da weapons
One query can only use one index. Bad for you !
Let's split the free and non-free weapons.
1a) free weapons
S
Hi All,
I have a partial table structure as below
tbl_user_main
user_id pk
user_level references tbl_level
user_class references tbl_class
user_level references tbl_level
tbl_level
level_id pk
level_name
level_points
tbl_weapon
wea
I have a problem with a select statement that I am using in a web search engine.
I have the following SQL:
SELECT
da_records.TITLE_EN AS TITLE,
da_records.AUTHOR_EN AS AUTHOR,
da_records.DESCRIPTION_EN AS DESCRIPTION,
da_records.PUBLISHER_EN AS PUBLISHER,
da_records.URL_EN AS URL,
da_reco
On Tue, Mar 23, 2004 at 20:02:32 +,
beyaNet Consultancy <[EMAIL PROTECTED]> wrote:
> Hi,
> I am trying to create a query which basically goes along the lines of:
>
> INSERT INTO tableX ( COL1, COL2 ) VALUES ( x, y ) where COL1 !=x and
> COL2 !=Y
>
> So, insert a record into tableX where th
Hi,
I am trying to create a query which basically goes along the lines of:
INSERT INTO tableX ( COL1, COL2 ) VALUES ( x, y ) where COL1 !=x and COL2 !=Y
So, insert a record into tableX where there is not already an existence of COL1 and COL2
Can this be done as I have described or is there a mor
On Friday 12 March 2004 14:36, Andrei Bintintan wrote:
> Hi to all,
>
> I have a big question.
>
> Can I write a query/function/agregate function (whatever) so that I can
> return the result of a query in a single line? I don't know if this is
> possible to be made and please if it is not possible
Hi to all,
I have a big question.
Can I write a query/function/agregate function
(whatever) so that I can return the result of a query in a single line? I
don't know if this is possible to be made and please if it is not possible
please say.
I better give an example:
table (id, nam
On Monday 16 February 2004 16:07, lowdog wrote:
> hey guys!
>
> I need your help in writing a php name-day searcher script.
Actually, you probably want a mysql list - this is a PostgreSQL list.
However, from what I can understand of your problem I think the easiest
solution for you might be to o
hey guys! I need your
help in writing a php name-day searcher script. here's what ive done:
i have the hostname, login and pw defined in a file, this one calls it:
then i made the
query, where (sorry for not translating the variable names, would be easier for
you to understand )
the "nev
PC> Hello,
PC> I would like to retrieve all the records from table A which have given
PC> lang_id and its modification date is later then modification date of
PC> the same id record with lang_id='pl'.
PC> Example:
PC> table A - data example
PC> ==
PC> id | modification_d
Hello,
I would like to retrieve all the records from table A which have given
lang_id and its modification date is later then modification date of
the same id record with lang_id='pl'.
Example:
table A - data example
==
id | modification_date | lang_id
+---
ED]>
Sent: Thursday, January 29, 2004 3:57 PM
Subject: Re: [SQL] SQL Query for Top Down fetching of childs
> On Thursday 29 January 2004 06:11, Kumar wrote:
> > Dear Friends,
> >
> > Postgres 7.3.4 on RH Linux 7.2.
> >
> > I need a query to get the Childs of a par
On Thursday 29 January 2004 06:11, Kumar wrote:
> Dear Friends,
>
> Postgres 7.3.4 on RH Linux 7.2.
>
> I need a query to get the Childs of a parent (Top down analysis). Need to
> list all the departments(Childs) of a parent organization. The table
> structure is
Two places to look for examples:
1
Dear Friends,
Postgres 7.3.4 on RH Linux 7.2.
I need a query to get the Childs of a parent (Top down
analysis). Need to list all the departments(Childs) of a parent organization.
The table structure is
CREATE TABLE organization( entity_id
int4, entity_name varchar(100), entity_type
> > I thought a view would be more appropriate, but
> > if I'm not wrong, a view does not accept any parameter
> > as input...
>
> But you can just define the view and select it with a WHERE clause
with
> your parameter, just like a normal table. Would that help?
Thanks! That's perfect. I join in
On Jan 16, 2004, at 8:30 PM, Philippe Lang wrote:
Hello,
I'd like to write a function similar to that:
CREATE FUNCTION public.report_join_parameter(char(6))
RETURNS ??? AS
Do I ***HAVE TO*** define a composite type for the columns my function
Hello,
I'd like to write a function similar to that:
CREATE FUNCTION public.report_join_parameter(char(6))
RETURNS ??? AS
'
SELECT
tableA.field1,
tableA.field2,
tableB.field1,
tableB.field2,
tableC.field1,
tableC.field2,
FROM tableA
INNER JOIN
Marek,
Not sure but, try switching the lines
db_data.mda_mod_con _CON,
db_data.set_mda_fue _FUE
with
db_data.set_mda_fue _FUE,
db_data.mda_mod_con _CON
so there query is:
SELECT
_CON.con_id,
_MOD.mod_ty,
_VER.version,
_YEA.year,
_CON.dri_id,
_CON.man_cod,
_ENG.eng_p
On Thu, Oct 09, 2003 at 20:52:58 +0100,
Marek Lewczuk <[EMAIL PROTECTED]> wrote:
> Hello,
> I'm in the middle of the migration process from MySQL to PostgreSQL and
> I cannot understand why this query isn't working (in MySQL it's working
> fine). PG returns: ERROR: Relation "_con" does not exist
Hello,
I'm in the middle of the migration process from MySQL to PostgreSQL and
I cannot understand why this query isn't working (in MySQL it's working
fine). PG returns: ERROR: Relation "_con" does not exist
This is my query:
SELECT
_CON.con_id,
_MOD.mod_ty,
_VER.version,
_YEA.year,
_C
>
> Hi I have a problem forming a query
> I have 3 tables salary(hrs, clock_in , clock_out)
> Break ( date, employe_id, net_time, break_in, break_out)
> Employee(employee_id, pay_rate, name)
>
> I need to get an hourly report till the current time for that day
> stating name, hour, no of hours, sal
Hi I have a problem forming a query
I have 3 tables salary(hrs, clock_in , clock_out)
Break ( date, employe_id,
net_time, break_in, break_out)
Employee(employee_id, pay_rate,
name)
I need to get an hourly report till the current time for
that day stating name, hour, no of hours, sal
mply and nicely use sequences.
> Pedro Igor
>
> - Original Message -
> From: "Achilleus Mantzios" <[EMAIL PROTECTED]>
> To: "Pedro Igor" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Tuesday, December 03, 2002 11:05
On Tue, 3 Dec 2002, Pedro Igor wrote:
> I have the following function:
> CREATE FUNCTION public.auto_incremento() RETURNS trigger AS '
> begin
> new.id = (select (max(id) + 1) from teste);
> return new;
> end;' LANGUAGE 'plpgsql'
>
> I created a trigger that uses this function, but i want to the f
I have the following function:
CREATE FUNCTION public.auto_incremento() RETURNS
trigger AS 'beginnew.id = (select (max(id) + 1) from teste);return new;end;'
LANGUAGE 'plpgsql'
I created a trigger that uses this function, but i
want to the function be usefull for all tables and not only to
Hello!
"Luis Sousa" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> This is a cryptographically signed message in MIME format.
>
> --ms080209060900030807050408
> Content-Type: text/plain; charset=us-ascii; format=flowed
> Content-Transfer-Encoding: 7
Tell me what did you try with limit and group by.
Where's IN, why don't you use EXISTS instead. It runs much master !
Regards,
Luis Sousa
Arcadius A. wrote:
Hello!
I hope that someone here could help.
I'm using PostgreSQL7.1.3
I have 3 tables in my DB: the tables are defined in the following
Hello!
I hope that someone here could help.
I'm using PostgreSQL7.1.3
I have 3 tables in my DB: the tables are defined in the following way:
CREATE TABLE category(
id SERIAL NOT NULL PRIMARY KEY,
// etc etc
)
;
CREATE TABLE subcategory(
id SERIAL NOT NULL PRIMARY KEY,
categoryid int CONSTRAI
Sorry If i didnt make clear which are the fields and which are the tables.
The tables are the ones "underlined", so I have cdroms, items, cdroms_items,
loans and reservations. I just left the important
fields in order not to confuse the people, and just wrote the name of the
fields that are the p
Dear all,
I want to do a query to my PostgreSQL database. I want to use it in a PHP web
client that I have got, but also
I have tried in the back-end.
I have the following tables on my database ( I translate the field names from
Spanish into English)
cdroms
---
code_cdroms
items
-
sir ,
kindly send me the solution of the above query.
1.
To calculate th no. of days between 01/01/2000 to 03/02/2001.
2.
TO calculate th time in newfoundland from centra standard time from
02-22-97 ,05.00 am.
_
Get Your Priv
On Wed, 24 Jan 2001 18:02, wrote:
> I want to show a certain person the commands I type and the query results,
> and I want to save them in a file. I tried \e filename and \E filename and
> its not working. Can someone please help me??
I don't know if this is available on your particular machine
I want to show a certain person the commands I type and the query results,
and I want to save them in a file. I tried \e filename and \E filename and
its not working. Can someone please help me??
Hope it helps:
1. If you use GROUP, the select list should sum|count|max ..., no single
field.
2. If you use NULL, the condition should be field IS [NOT] NULL, = NULL
will give the wrong answer.
Jie LIANG
Internet Products Inc.
10350 Science Center Drive
Suite 100, San Diego, CA 92121
O
I hope it may help:
1. if you use group clause in a select stmt, the select list must be
agregate function such as sum(field),count(field), max(field)...,
cannot use field.
2. for field have NULL field, should use field IS NULL, = NULL will give
you wrong result!
Jie LIANG
Internet Products In
On Tue, 19 Dec 2000 [EMAIL PROTECTED] wrote:
> Hello there
>
> I have a question regarding a SQL statement.
>
> When I execute (and that's what I need)
>
> SELECT Zylinder.Z_durch_soll, Zylinder.Z_id, Zylinder.Z_durch_ist,
> ((Zylinder.Z_durch_soll+0.12) - Zylinder.Z_durch_ist) AS durchmesserd
Hello there
I have a question regarding a SQL statement.
When I execute (and that's what I need)
SELECT Zylinder.Z_durch_soll, Zylinder.Z_id, Zylinder.Z_durch_ist,
((Zylinder.Z_durch_soll+0.12) - Zylinder.Z_durch_ist) AS durchmesserdelta,
(Zylinder.Z_durch_soll+0.12) AS effektiv
FROM Auftrag,Zy
> Is it possible to carry out the comparison in the following manner
> select name from table where 00:12 is between 23:58 and 00:30
You could try something like
WHERE ('00:12' BETWEEN startTime AND endTime
AND startTime <= endTime)
OR ('00:12' NOT BETWEEN endTime AND startTime
Hi,
I am attempting to write a sql query that compares times on a 24 hr
clock
eg
09:00<16:30 and 21:00>16:30
09:00 is the start time and 16:30 is the end time. The problem is that
if the start time is 23:58 and the end time is 00:30 (next day) is there
any way to carry out this comparison withou
On Fri, 22 Sep 2000, Tom Lane wrote:
> indexscans; the current code may have overcorrected a shade, but I think
> it's closer to reality than 6.5 was.
>
> As Hiroshi already commented, the difference in results suggests that
> the desired data is very nonuniformly scattered in the table. 7.0
>
Stephan Szabo <[EMAIL PROTECTED]> writes:
>> Ok I agree with you on the real database there are 127,300 rows and there
>> are certanly a great number of rows > 'AAA'. But, supose I make a query
>> select * from table where code > 'AAA' limit 10. it will read the entire
>> table only to give me the
> -Original Message-
> From: Sergio de Almeida Lenzi
>
> On Wed, 20 Sep 2000, Stephan Szabo wrote:
>
> > On Wed, 20 Sep 2000, User Lenzi wrote:
> >
> > > if I start a query:
> > >
> > > explain select * from teste where login = 'xxx'
> > > results:
> > > Index Scan using teste1 on teste
On Thu, 21 Sep 2000, Sergio de Almeida Lenzi wrote:
> > > On a machine running version 6.5 both queries results index scan.
> > >
> > > this results that the version 6.5 is faster than version 7.0.2 on this
> > > kind of
> > > query.
> > >
> > >
> > > Any explanation???
> >
> > Have you done
On Wed, 20 Sep 2000, Stephan Szabo wrote:
> On Wed, 20 Sep 2000, User Lenzi wrote:
>
> > if I start a query:
> >
> > explain select * from teste where login = 'xxx'
> > results:
> > Index Scan using teste1 on teste (cost=0.00..97.88 rows=25 )
> >
> >
> > however a query:
> > explain selec
i" <[EMAIL PROTECTED]>
Cc: "pgsql-sql" <[EMAIL PROTECTED]>
Sent: Wednesday, September 20, 2000 11:23 AM
Subject: Re: [SQL] sql query not using indexes
> On Wed, 20 Sep 2000, User Lenzi wrote:
>
> > if I start a query:
> >
> > explain select * fro
On Wed, 20 Sep 2000, User Lenzi wrote:
> if I start a query:
>
> explain select * from teste where login = 'xxx'
> results:
> Index Scan using teste1 on teste (cost=0.00..97.88 rows=25 )
>
>
> however a query:
> explain select * from teste where login > 'AAA'
> results:
> Seq Scan on teste .
Hello,
I am using last version of postgresql, 7.0.2 on a FreeBSD or Linux box
I create a table:
create table teste (
login text,
datein datetime);
create index teste1 on teste (login);
if I start a query:
explain select * from teste where login = 'xxx'
results:
Index Scan using te
79 matches
Mail list logo