[SQL] i have a big trouble

2001-01-24 Thread Sandis Jerics
TEXT, url VARCHAR(30), url_txt VARCHAR(50) ); an example row of data (tab separated) attached. anyone may have an idea? -- Sandis 609 9237502 45 a 2 2000-03-24 17:09:52+02 24.03.2000 ON THE RESULTS OF THE VISIT IN BRUSSELS Today on the 24th of M

[SQL] sorting the text values as integers

2000-12-20 Thread Sandis Jerics
HEN position('x' in m1)>1 THEN int2(substring(m1 from 1 for position('x' in m1)-1)) ELSE float4(m1) END) i never used CASE WHEN ... THEN ... ELSE ... END construct before, & assume the above is errorneus by default. --:)-- Best regards, Sandis

[SQL] HELP! ... pg_locale ???

2000-10-26 Thread Sandis Jerics
ie(pg_errormessage()); -- it works fine when written on the single line but now i see the above stupid error message.. it so funny to have to rewrite queries to single line?.. --:)-- Best regards, Sandis

[SQL] Re: NULL

2000-10-24 Thread Sandis Jerics
search archives, but it seems deadly slow... Thanks in advance, sandis

Re[2]: [SQL] data integrity

2000-08-15 Thread Sandis
JA> I would like to know such a place. JA> Jesus. Thank you. I found what i need about referential integrity here http://www.postgresql.org/mhonarc/pgsql-general/1999-08/msg00474.html ye,in Access it needed to check 1 checkbox, but here one should write some code.. --:)

[SQL] data integrity

2000-08-15 Thread Sandis
this 'project', do you want to delete them all? how about joins in delete query? DELETE FROM projects, contacts WHERE projects.contact = contacts.id AND projects.id = '$id'; he, i wrote the answer myself. may be dont send it at all? can someone suggest some good online resour

Re: [SQL] Extracting data by months

2000-08-04 Thread Sandis
I do it like this: SELECT datums FROM jaunumi WHERE date_part('year',datetime(datums)) = '2000' AND date_part('month',datetime(datums)) = '08'; Where datums is a timestamp field. Regards, Sandis Jerics www.mediaparks.lv > This might

[SQL] Simple concatenation in select query

2000-07-31 Thread Sandis
Hello, Sorry for the stupid posting, but.. There was a string concatenation function in MySQL: SELECT CONCAT(first_name, " ", last_name) FROM table; Is there a similar function in Postgres? Certainly, it's possible to live without it, but i'd like to write as above, doing concatenation in place

Re: [SQL] date comparision ???

2000-07-12 Thread sandis
esentation 'datums_' datums_ is a timestamp field. How do i get it's value to use in date_part() function?? date_part('year',datums_) and date_part('year',datetime datums_) doesnt work also! - Original Message - From: Jie Liang To: sandis Sent: Friday, July

[SQL] date comparision

2000-07-07 Thread sandis
Is anyone out here can give some advice? i have a table with a timestamp field. i should know if there is records for the particular year and month so i need a query like (in MySQL it was very simple, but i should move to postgres!): SELECT something FROM mytable WHERE MONTH('timestamp_field')=0