RE: select problem with "not equal" syntax

2002-09-30 Thread Sean Moshenko

Just a suggestion:

SELECT hl7incom.id
FROM hl7incom, pid_segment
WHERE hl7incom.msg LIKE '%PID%'
AND not(pid_segment.id = hl7incom.id)
GROUP BY hl7incom.id;

Otherwise my only other suggestion would involve using the 'NOT IN'
logic, but I think that might be too convoluted for your needs.


-Original Message-
From: Gebhardt, Karsten [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 01, 2002 12:07 AM
To: '[EMAIL PROTECTED]'
Subject: RE: select problem with "not equal" syntax


No way, I've already tried this.

> I have two tables
>
> CREATE TABLE pid_segment (
> id INT NOT NULL UNIQUE PRIMARY KEY,
> msg TEXT)
> TYPE=INNODB
>
> CREATE TABLE hl7incom(
> id INT NOT NULL AUTO_INCREMENT UNIQUE PRIMARY KEY REFERENCES pid_segment
> (id).
> msg TEXT,
> time TIMESTAMP NOT NULL)
> TYPE=INNODB
>
> There are few data stored in both tables. Now I will select new messages
> from hl7incom, where hl7incom.id is not equal pid_segment.id and store
this
> id, msg in pid_segment.
>
> With query...
>
> SELECT hl7incom.id
> FROM hl7incom, pid_segment
> WHERE hl7incom.msg LIKE '%PID%'
> AND pid_segment.id != hl7incom.id
> GROUP BY hl7incom.id;
>
Try

SELECT hl7incom.id
FROM hl7incom, pid_segment
WHERE hl7incom.msg LIKE '%PID%'
AND pid_segment.id<>hl7incom.id
GROUP BY hl7incom.id;

John Coder

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Loading data into a table

2002-10-07 Thread Sean Moshenko

I seem to have run into a rather peculiar problem.  I was attempting to load
data into a table from a file.  I checked with the online documentation and
found the following syntax:

LOAD DATA LOCAL INFILE "pet.txt" INTO TABLE pet;

I used this format exactly (with my own file and table names of course) and
was greeted with the following error message:

ERROR 1148: The used command is not allowed with this MySQL version

Calling 'mysql --version' I have found that I am using version 11.18 Distrib
3.23.52 (on w2k).  Is there another means by which I can get large amounts
of data into my table without using a whole whack of INSERT statements?

Any help would be greatly appreciated.

Sean



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




selecting a certain number of rows

2002-10-10 Thread Sean Moshenko

Hi,

In a previous job I had the (mis)fortune to develop software exclusively on
DB2.  While doing so I would often use FETCH to examine a certain number of
records.  Example:

SELECT * from table FETCH FIRST 10 ROWS ONLY.

When I use this particular syntax in any mysql interface (I've used 2) I get
syntax error statements.  Now either I have forgotten the exact syntax
(unlikely, but possible) or mysql doesn't support this.  Assuming the
latter, is there an alternative method to acheive my desired result or do I
have the syntax wrong?

Any help would be greatly appreciated.

Sean



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: accessing mysql from C

2002-11-08 Thread Sean Moshenko
mysql_connect() is deprecated function.  Try using mysql_real_connect().
I've used and haven't experience any problems with it.

http://www.mysql.com/documentation/mysql/bychapter/manual_Clients.html#mysql
_real_connect

Sean

-Original Message-
From: Rahul Amaram-RollNo.286 [mailto:rahul@;gdit.iiit.net]
Sent: Friday, November 08, 2002 11:34 AM
To: [EMAIL PROTECTED]
Subject: accessing mysql from C


whenever i try to execute a C file which uses the mysql_connect method
i get the following error.


undefined reference to mysql_connect


Please note that I have tried the following options.


gcc -lmysqlclient file.c

gcc -L /usr/lib/mysql -lmysqlclient file.c

gcc -L /usr/lib/mysql -I /usr/include/mysql -lmysqlclient file.c


Also note that .so files are not present in /usr/lib/mysql. I'm
not sure if these .so are necessary. This is urgent. If you have any idea
about how to solve this problem, pleaaae let me know!


My version is 4.0.4. Please let me know if any extra rpms other
than server, client, shared and devel are necessary for using mysql from C.
  Rahul.


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php