RE: Fetching records from 2 tables

2002-02-11 Thread Terje Kristensen
2 queries with left outer join will do the trick. select a.id,b.id from a left outer join b on a.id = b.id where b.id is NULL; this will give a list over all fields that exist in table a but not in table b select a.id,b.id from b left outer join a on a.id = b.id where a.id is NULL; this will

RE: Fetching records from 2 tables

2002-02-08 Thread Terje Kristensen
2 queries with left outer join will do the trick. select a.id,b.id from a left outer join b on a.id = b.id where b.id is NULL; this will give a list over all fields that exist in table a but not in table b select a.id,b.id from b left outer join a on a.id = b.id where a.id is NULL; this will

RE: Do not understand a method without sub-selects

2002-01-02 Thread Terje Kristensen
How about something like this ? SELECT * FROM log_data_sig AS l1 LEFT JOIN log_data_sig AS l2 ON l1.user = l2.user WHERE l1.type=join AND l1.user=EXTERNAL_USER_ID AND l2.type = sign AND l1.timestamp l2.timestamp ORDER BY l1.timestamp DESC LIMIT 1; Terje K -Original Message- From:

SV: can i do this with sql?

2001-11-27 Thread Terje Kristensen
I dont think you can do that, but if you create a table counter with one number column and insert all the numbers from 1 to 10 or what number would be appropriate, then you can left join your_table with counter on the id = number column. select * from counter left join your_table on

SV: Comparing strings as ints

2001-10-30 Thread Terje Kristensen
select floor('5') = floor('6'); TK -Opprinnelig melding- Fra: Daniel James [mailto:[EMAIL PROTECTED]] Sendt: 30. oktober 2001 04:32 Til: [EMAIL PROTECTED] Emne: Comparing strings as ints Hi Everyone, After staring blankly at the mysql manual for a long time, I thought it

SV: LIKE '%%' with fields.

2001-10-30 Thread Terje Kristensen
use : SELECT whois_domain.domain FROM whois_domain, filter WHERE (whois_domain.record LIKE concat('%',filter.filter,'%') TK -Opprinnelig melding- Fra: abercrombie fitch [mailto:[EMAIL PROTECTED]] Sendt: 30. oktober 2001 13:35 Til: [EMAIL PROTECTED] Emne: LIKE '%%' with fields.

SV: LIKE '%%' with fields.

2001-10-30 Thread Terje Kristensen
ehh .. forgot a ) on my sql. the right one is below SELECT whois_domain.domain FROM whois_domain, filter WHERE (whois_domain.record LIKE concat('%',filter.filter,'%')) TK -Opprinnelig melding- Fra: abercrombie fitch [mailto:[EMAIL PROTECTED]] Sendt: 30. oktober 2001 13:35 Til:

SV: Max int value of char field? How to find...

2001-10-22 Thread Terje Kristensen
How about select max(floor(field)) from table ? TK -Opprinnelig melding- Fra: Kraa de Simon [mailto:[EMAIL PROTECTED]] Sendt: 22. oktober 2001 08:44 Til: Php-General (E-mail); MySQL (E-mail) Emne: Max int value of char field? How to find... Hello all, How can I find the

SV: Simple SELECT query (or so I thought)

2001-09-19 Thread Terje Kristensen
If you change you order by to order by username, wucount desc, rank desc Won't this group it the way you want it ?? Terje K -Opprinnelig melding- Fra: Solsberry, Glendon [mailto:[EMAIL PROTECTED]] Sendt: 19. september 2001 15:29 Til: '[EMAIL PROTECTED]' Emne: Simple SELECT query

Re: Hoping for Crash recovery Miracle

2001-09-18 Thread Terje Kristensen
You might be able to do a few select * from mubo_boekhoud_boekhoud where queries to be able to dump out most of the data in the table. Then you can drop and recreate the table and import the data. It's worth a try anyway. Terje K -Opprinnelig melding- Fra: David Bouw

SV: Mysql on HPUX10.20

2001-09-14 Thread Terje Kristensen
Hi Leandro This is a HPUX problem. This errormessage gives you the real problem : : setrlimit couldn't increase number of open files to more than 60 you have to change the kernel settings to allow the OS to use more than 60 simultaneous open files. if you use the sam program and choose sam

A question about load / queries pr second

2001-09-07 Thread Terje Kristensen
I have a HP-UX server with Perl 5.005_03, MySQL 3.23.39 for hp-hpux11.00 (hppa2.0w), Apache/1.3.20. The load are rather high, and Queries per second avg: 94.859 This is an local B2B installation som we are really not getting any traffic between 4PM and 7AM We have peeks where there is more than

How to get TABLENAME.FIELDNAME syntax in the return values from MySQL

2001-09-05 Thread Terje Kristensen
In a SQL like : SELECT table1.f1,table2.f1 FROM table1,table2 you get a listing like this. +++ | f1 | f1 | +++ | 1 | 1 | | 1 | 2 | | 1 | 3 | +++ When using the DBI function fetchrow_hashref() you get only one value since the key is not unique. Is there a way to get