[SQL] search facilities

2003-11-07 Thread Martin Kuria
Hi,
I have a content management system, for my database driven website developed 
using php and postgresql but I don't know how to develop a search facility 
for it.

How do I go about it?.

I have seen database driven website developed using php and postgresql and 
they have their built search facilities where can I learn to develop my 
customized search facility please do advice.

Kind Regards

+-+
| Martin W. Kuria (Mr.) [EMAIL PROTECTED]
++
_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail

---(end of broadcast)---
TIP 6: Have you searched our list archives?
  http://archives.postgresql.org


[SQL] DateDiff in PostgreSQL

2003-11-07 Thread George A.J
Hi,
i am converting a MSSQL Server database to PostgreSQL.
Using PostgreSQL version 7.3.2.
Is there any function like the DateDiff() in MSSQL Server. 
ie, a function that returns difference of two dates(timestamp) in days or months or year..
The - operator for timestamp retuns the intervel in days only.
Please help
jinujose
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

Re: [SQL] DateDiff in PostgreSQL

2003-11-07 Thread Yasir Malik
Hi,
You can use the age() function to find the difference between dates, and
use the extract() function to get the years, months, days, etc.
Yasir

On Fri, 7 Nov 2003, George A.J wrote:

> Date: Fri, 7 Nov 2003 05:34:09 -0800 (PST)
> From: George A.J <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: [SQL] DateDiff in PostgreSQL
>
>
> Hi,
>
> i am converting a MSSQL Server database to PostgreSQL.
>
> Using PostgreSQL version 7.3.2.
>
> Is there any function like the DateDiff() in MSSQL Server.
>
> ie, a function that returns difference of two dates(timestamp) in days or months or 
> year..
>
> The - operator for timestamp retuns the intervel in days only.
>
> Please help
>
> jinujose
>
>
> -
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [SQL] DateDiff in PostgreSQL

2003-11-07 Thread Tomasz Myrta
Dnia 2003-11-07 14:34, Użytkownik George A.J napisał:
Hi,

i am converting a MSSQL Server database to PostgreSQL.

Using PostgreSQL version 7.3.2.

Is there any function like the DateDiff() in MSSQL Server.

ie, a function that returns difference of two dates(timestamp) in days 
or months or year..

The - operator for timestamp retuns the intervel in days only.
1. You can convert timestamps to dates and then substract them. The 
result will be days::integer.

2. Interval result is not a problem - you can extract epoch from it. The 
result is seconds::integer - do whatever you want with it.

Regards,
Tomasz Myrta
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [SQL] DateDiff in PostgreSQL

2003-11-07 Thread George A.J
Yasir Malik <[EMAIL PROTECTED]> wrote:

>You can use the age() function to find the difference between dates, and>use the extract() function to get the years, months, days, etc.>Yasir
this will not work because age('25/12/1975','30/01/1986')wil return '10 year 1 month 5 days' 
extract only returns years -10, moths-1, days-5.
this is not i want.Actual month  difference between the dates are 121 months.
jinu jose
 
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

Re: [SQL] DateDiff in PostgreSQL

2003-11-07 Thread Rod Taylor
> ie, a function that returns difference of two dates(timestamp) in days
> or months or year..
> 
> The - operator for timestamp retuns the intervel in days only.

rbt=# select extract('days' from current_timestamp -
'2003-01-01'::timestamp);
 date_part
---
   310
(1 row)


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [SQL] SQL to PLC to diverter gate, can this be done?

2003-11-07 Thread Christopher Browne
Centuries ago, Nostradamus foresaw when [EMAIL PROTECTED] (Razorbak71) would write:
> First, I know nothing about PLC's, but I was wondering is there a
> way to extract data from a SQL database file, feed that to a PLC is
> some manner, and then have the PLC trigger a diverter gate based on
> the value in the table exceeding a certain value, to divert parts to
> another location.
>
> Am I off base, or is there something out there that will allow or
> help me to do this.  Any help would be greatly appreciated.

It all depends on how you are able to program the PLC.  They tend to
have pretty proprietary tools that are very much dependent on the
vendor.

My little brother works for Omron, and does some pretty fancy things
with their PLCs.  But since the languages Omron uses aren't the same
as are used with similar products from (say) Siemens, knowing one
platform doesn't necessarily help with the other.  (They commonly use
languages resembling BASIC...)

I think you need to know a LOT more about the PLC system in question,
and that knowledge is not likely to be found here.  What you want is
probably feasible in some sense, although it's likely to be rather
fiddly.  

And your use of the term "SQL database file" suggests some confusion
on your part as to how the SQL side would work.  While PostgreSQL
implements tables in files, you don't read data from the files, but
instead ask the "postmaster" to give it to you.  You might need to
drop the data into a separate file outside the database in order to
get it into a form that the PLC can get at...
-- 
If this was helpful,  rate me
http://www3.sympatico.ca/cbbrowne/linux.html
"Microsoft is a cross between the Borg and the Ferengi. Unfortunately,
they  use  Borg  to  do  their  marketing  and  Ferengi  to  do  their
programming."  -- Simon Slavin in asr

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


[SQL]

2003-11-07 Thread ronald

Hello everyone, Good day! Could anyone help me translate this query in Microsoft
Access to Postgresql. I'm having a difficulty. Pls...

Query1:
SELECT items.description, Sum(supplieditems.qty) AS SumOfqty
FROM items INNER JOIN supplieditems ON items.itemno = supplieditems.itemno
GROUP BY items.description;

Query2:
SELECT [items].[description], Sum([customer].[qty]) AS SumOfqty
FROM (items INNER JOIN OtherItem ON [items].[itemno]=[OtherItem].[Itemno]) INNER
JOIN customer ON [OtherItem].[Itemno]=[customer].[itemcode]
GROUP BY [items].[description];

Query3:
SELECT [Query1].[SumOfqty], [Query2].[SumOfqty],
[Query1]![SumOfqty]-[Query2]![SumOfqty] AS remain
FROM Query1, Query2;

I have translated Query1 and Query2 in POSTGRESQL but I don't know how to
implement Query3.



Are you a student of MSU-IIT? Log on http://my.msuiit.edu.ph 
and sign up for your My.MSUIIT E-mail Plus account now!
Are you an MSU-IIT alumnus? Log on http://www.alumni.msuiit.edu.ph


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster