Hi all,
Hopefully a quick question...
Why does:
nmc= SELECT 'Y' AS local FROM domains WHERE dom_name='test.com';
local
---
Y
(1 row)
Work but:
nmc= SELECT 'Y' AS local FROM domains WHERE '@'||dom_name IN
('[EMAIL PROTECTED]');
local
---
(0 rows)
Not work?
I am sure I
On 9/4/07, Madison Kelly [EMAIL PROTECTED] wrote:
I am sure I am missing something simple. :)
Yeah...
'[EMAIL PROTECTED]' '@test.com'
---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster
On 9/4/07, Madison Kelly [EMAIL PROTECTED] wrote:
Hi all,
Hopefully a quick question...
Why does:
nmc= SELECT 'Y' AS local FROM domains WHERE dom_name='test.com';
local
---
Y
(1 row)
Work but:
nmc= SELECT 'Y' AS local FROM domains WHERE '@'||dom_name IN
('[EMAIL
Madison Kelly wrote:
nmc= SELECT 'Y' AS local FROM domains WHERE '@'||dom_name IN
('[EMAIL PROTECTED]');
local
---
(0 rows)
Not work?
I don't think IN does what you think it does. It's not a substring-test,
but a set test:
SELECT 1 WHERE 'x' IN ('a','b','c','x');
SELECT a FROM foo
Rodrigo De León wrote:
On 9/4/07, Madison Kelly [EMAIL PROTECTED] wrote:
I am sure I am missing something simple. :)
Yeah...
'[EMAIL PROTECTED]' '@test.com'
Well now, don't I feel silly. *sigh*
Thanks!
Madi
---(end of broadcast)---
TIP
Richard Huxton wrote:
Madison Kelly wrote:
nmc= SELECT 'Y' AS local FROM domains WHERE '@'||dom_name IN
('[EMAIL PROTECTED]');
local
---
(0 rows)
Not work?
I don't think IN does what you think it does. It's not a substring-test,
but a set test:
SELECT 1 WHERE 'x' IN
Madison Kelly wrote:
SELECT 'Y' AS local FROM domains d, users u WHERE u.usr_dom_id=d.dom_id
AND u.usr_email||'@'||d.dom_name IN ('[EMAIL PROTECTED]');
Though this may not be the most efficient. In my case, the 'usr_email'
is the LHS of the '@' sign and 'dom_name' is the domain name. If I
Merlin Moncure wrote:
I seem to recall giving out a query about that in the IRC channel a
while back...so if you got it from me, now I'll attempt to finish the
job :-).
If you can get postfix to look at a view, maybe you could
CREATE VIEW email_v AS
SELECT
usr_email, dom_name,
Hi all,
I am pretty sure I've done this before, but I am drawing a blank on
how I did it or even what commands I need. Missing the later makes it
hard to search. :P
I've got Postfix working using PostgreSQL as the backend on a small,
simple test database where I have a simple table
Woops, I wasn't careful enough when I wrote that email, sorry. The
results showed my real domains instead of 'test.com'. I had different
domains in the test and real DBs.
Madison Kelly wrote:
email_file
-
feneon.com/mkelly/inbox
and
email_file
Madison Kelly wrote:
Hi all,
I am pretty sure I've done this before, but I am drawing a blank on
how I did it or even what commands I need. Missing the later makes it
hard to search. :P
I've got Postfix working using PostgreSQL as the backend on a small,
simple test database where I
On 8/30/07, Madison Kelly [EMAIL PROTECTED] wrote:
Hi all,
I am pretty sure I've done this before, but I am drawing a blank on
how I did it or even what commands I need. Missing the later makes it
hard to search. :P
I've got Postfix working using PostgreSQL as the backend on a small,
Am 2007-08-17 12:53:41, schrieb Michael Glaesemann:
On Aug 17, 2007, at 7:27 , Michelle Konzack wrote:
*
* Do not Cc: me, because I am on THIS list, if I write here.*
You might want to consider changing your
On 8/18/07, Michelle Konzack [EMAIL PROTECTED] wrote:
Am 2007-08-17 12:53:41, schrieb Michael Glaesemann:
(Is is just me or have there been a lot of queries that can be solved
using DISTINCT ON recently?)
I do not know... Since when does DISTINCT ON exist?
I have been lurking on this
Michelle Konzack wrote:
Am 2007-08-17 12:53:41, schrieb Michael Glaesemann:
On Aug 17, 2007, at 7:27 , Michelle Konzack wrote:
*
* Do not Cc: me, because I am on THIS list, if I write here.*
You might
*
* Do not Cc: me, because I am on THIS list, if I write here.*
* Keine Cc: an mich, bin auf DIESER Liste wenn ich hier schreibe. *
* Ne me mettez pas en Cc:, je suis sur CETTE liste, si j'ecris ici. *
On Aug 17, 2007, at 7:27 , Michelle Konzack wrote:
*
* Do not Cc: me, because I am on THIS list, if I write here.*
You might want to consider changing your mailing list subscription
settings to eliminatecc, e.g.,
On Aug 3, 11:17 pm, [EMAIL PROTECTED] (Karl Denninger) wrote:
Ideas?
SELECT item.user, item.subject, item.number
FROM item, seen
WHERE item.user = seen.user
AND item.number = seen.number
AND item.changed seen.lastviewed
UNION
SELECT item.user, item.subject, item.number
FROM item,
Assume the following tables:
Table ITEM (user text, subject text, number integer, changed timestamp);
table SEEN (user text, number integer, lastviewed timestamp);
Ok, now the data in the SEEN table will have one tuple for each user
and number in the table ITEM which a user has viewed, and the
Hi,
i want to calculate the price difference, change% of 2 price records. Is
there an easy way to do that within one query, rather than writing a
function?
Example:
company, price_date, price, change, change_perc
compA, 20060203,100,,,
compA, 20060202,100,,,
compA, 20060201,100,,,
for one,
On Sat, Mar 04, 2006 at 03:35:02 +1100,
Alex [EMAIL PROTECTED] wrote:
Hi,
i want to calculate the price difference, change% of 2 price records. Is
there an easy way to do that within one query, rather than writing a
function?
You can use a self join to do this. It won't be spectaculatly
All,
thanks for the many suggestions
Alex
Manfred Koizar wrote:
On Thu, 20 Nov 2003 16:52:37 +0900, Alex [EMAIL PROTECTED] wrote:
Is there an easy way to write a select statement that returns me the
frist free number or any within the range of 200?
For example if 1-30, and 32-50 are occupied
On Thu, 20 Nov 2003, Alex wrote:
Is there an easy way to write a select statement that returns me the
frist free number or any within the range of 200?
For example if 1-30, and 32-50 are occupied then i would like to fill in
the new entry with id 31.
If you had a table with an id column and
On Thu, 20 Nov 2003 16:52:37 +0900, Alex [EMAIL PROTECTED] wrote:
Is there an easy way to write a select statement that returns me the
frist free number or any within the range of 200?
For example if 1-30, and 32-50 are occupied then i would like to fill in
the new entry with id 31.
Fortunately
Kris Jurka wrote:
A useful generic function would be one something like range(min,max) that
would return a set of rows so you wouldn't have to actually have a table.
You mean like this?
CREATE OR REPLACE FUNCTION test(int,int) RETURNS SETOF int AS '
BEGIN
FOR i IN $1..$2 LOOP
RETURN NEXT i;
On Tuesday 04 November 2003 10:54, Alex wrote:
Hi,
I have a bit string , 7 bits, every bit representing a day of the week.
e.g. 1110011.
Is there and easy way where I can translate/format that string in a query.
I want to give the string back with a '-' for every 0 and the first char
of the
Hi,
I have a bit string , 7 bits, every bit representing a day of the week.
e.g. 1110011.
Is there and easy way where I can translate/format that string in a query.
I want to give the string back with a '-' for every 0 and the first char
of the Day for every '1'.
example 1100111 = SM--TFS.
Jeffrey,
second solution is a beauty... thanks a lot.
Alex
Jeffrey Melloy wrote:
If I'm understanding you correctly, you can do something like:
select cola,
colb,
exists
(select 'x'
from tableb
where colc = colb)
from
On Mon, 1 Sep 2003, Alex wrote:
Hi,
I need to form a query where i can add some columns based on the result.
Table A
ColA, ColB
--
1 A
2 B
3 A
Table B
ColC
A
If A exists if would like the result back as
1 A OK
2 B NG
3 A OK
Is it
If I'm understanding you correctly, you can do something like:
select cola,
colb,
exists
(select 'x'
from tableb
where colc = colb)
from tablea
Since that has a subselect, you may get better performance with
something
On Sat, 29 Jul 2000, [EMAIL PROTECTED] wrote:
Dear all,
Is there a way I can select the top 50 rows from table, 51 - 100 rows from
table etc (with order clause)? It is because I am writing a message board
and I would like to create the prev/next button on different page.
Many
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Is there a way I can select the top 50 rows from table, 51 - 100 rows from
table etc (with order clause)? It is because I am writing a message board
and I would like to create the prev/next button on different page.
Look at the
32 matches
Mail list logo