RE: What's the syntax for using ENCODE()?

2001-03-01 Thread Julian Strickland


You have an odd number of brackets in each case, you are missing a " ) "
 -Original Message-
 From: Kinney Baughman [SMTP:[EMAIL PROTECTED]]
 Sent: Wednesday, February 28, 2001 11:18 PM
 To:   [EMAIL PROTECTED]
 Subject:  What's the syntax for using ENCODE()?
 
 Hi,
 
 I'm trying to encrypt credit_card numbers in MySQL 3.23.33.  I want to
 decrypt them when I retrieve them.
 
 I've tried:
 
 mysql insert into payment (payname1,ccaccount) values
 ("Kinney",encode('','Ilwfci');
 ERROR 1064: You have an error in your SQL syntax near '' at line 1
 
 mysql insert into payment (payname1,ccaccount) values
 ("Kinney",encode(,Ilwfci);
 ERROR 1064: You have an error in your SQL syntax near 'Ilwfci)' at line 1
 
 mysql insert into payment (payname1,ccaccount) values
 ("Kinney",ENCODE('',Ilwfci);
 ERROR 1064: You have an error in your SQL syntax near 'Ilwfci)' at line 1
 
 mysql insert into payment (payname1,ccaccount) values
 ("Kinney",encode(,'Ilwfci');
 ERROR 1064: You have an error in your SQL syntax near '' at line 1
 
 I have "ccaccount" set up as a blob.
 
 As you can see, all I get is error messages.  What am I doing wrong?
 
 After I get them in, my next question is how to get them back out.
 
 According to the manual, one should use: DECODE(crypt_str,pass_str) where
 "crypt_str" should be a string returned from ENCODE().  This seems to be a
 catch-22, though.  Wouldn't I have to know the value of "crypt_str", i.e.
 the credit_card number in order to get that encrypted string out of
 ENCODE()?
 
 Thanks.  
 -- 
 +---+
 | Kinney Baughman  Appalachian State University |
 | Appalachian Regional Development InstituteBoone, NC 28608 |
 | Email:   [EMAIL PROTECTED]   Phone:  (828) 262-6523 |
 +---+
 
 -
 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




RE: auto_increment

2001-02-28 Thread Julian Strickland

The behavior differs between ISAM tables and MyISAM ones. Its all in the
manual.

 -Original Message-
 From: Bard dZen [SMTP:[EMAIL PROTECTED]]
 Sent: Wednesday, February 28, 2001 1:23 PM
 To:   [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Cc:   [EMAIL PROTECTED]
 Subject:  Re: auto_increment
 
 Well it isn't.  I created a table with auto_increment, added 25 records, 
 deleted 5, did an insert, and the next auto number was 21.
 
 
 From: Steve Ruby [EMAIL PROTECTED]
 To: John Tsangaris [EMAIL PROTECTED]
 CC: [EMAIL PROTECTED]
 Subject: Re: auto_increment
 Date: Mon, 26 Feb 2001 15:02:38 -0700
 
 John Tsangaris wrote:
  
   If I turn on auto increment and let it do it's thing and then later on
   delete a few of the entries (let's say 1, 2, 3) and the current high 
 entry
   has an id of 45.. why does mysql continue with 46 instead of using up
 1, 
 2,
   and 3 first?  Is there a way to bypass this?
  
   John
 
 
 To avoid duplication of those keys in many cases.  For example if you
 archived 1,2,3 and removed them from the table you may want to add them 
 back
 in and you don't want their ID's to be taken.  Or you may have references
 to 1,2,3 in other tables, if you delete them it would be wrong
 for the references to point to the new 1,2,3. Of course you should
 probably
 delete the references but if you didn't it would be confusing that
 you had pointers to the wrong lines.
 
 The point is that auto_increment generates UNIQUE values, and those
 values should be unique for the life of the table, not pending deletes.
 
 -
 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
 
 
 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com
 
 
 -
 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




RE: RDBMS question on coding expanding series-like fields

2001-02-27 Thread Julian Strickland

You need to re structure it using a table called say Questions with the
following sorts of fields
QID Id number
QTitle Title eg Question1
Q The question text
A The answer text
R The rank or score of the question

That way you add questions simply by adding records to the table.

you might find the tutorials at this site useful
http://www.rd-robotics.com/accesscommunity/tutes/index.html
although it is based on access I found it useful.

 -Original Message-
 From: WCBaker [SMTP:[EMAIL PROTECTED]]
 Sent: 27 February 2001 16:25
 To:   MySQL
 Subject:  RDBMS question on coding "expanding series-like fields"
 
 Hi!
 
 I have a Test Questions database.   Right now I have a hard-coded limit of
 200 questions in it; I actually made a table with field names like Quest1,
 Quest2. . . Quest200.  However, I know that I am not using the power of
 MySql in setting it up this way.   This is more an example of my own
 ignorance than of the power of MySql!
 
 Can someone explain how to set up a table with a fieldname that 'expands'
 (maybe something like Quest[i] where "i" can be incremented as required).
 Is there more than one way of doing this?  Is there a place where I might
 see some sample code?
 
 I did look up 'enum' and 'set' in the manual but I don't feel confident
 with
 my grasp of the limited explanations given of these.   My feeling is that
 perhaps 'enum' would be a candidate for what I need, as 'set' has a limit
 on
 how big the set can get.I would like to have the possibility of data
 expansion as needed.
 
 Any tips whatever would be appreciated!
 
 Thanks very much!
 
 Cheers!
 
 -Warren
 
 
 -
 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




RE: Error in select .... from.... where... with BDB

2001-02-26 Thread Julian Strickland

It would seem that you are getting the character corresponding to the ASCII
code 53 as the result of the first query. Try inserting the value for logo
in your table without the quotes round the 53 and see if the results of the
queries become consistent. IMHO this is a bug because the two queries are
returning different interpretations of the stored data.

 -Original Message-
 From: TisSoft s.c. [SMTP:[EMAIL PROTECTED]]
 Sent: 26 February 2001 13:20
 To:   [EMAIL PROTECTED]
 Subject:  Error in "select  from where..." with BDB
 
 Description:
   I made a table:
   CREATE TABLE parametry (
   SYMBOL varchar(30) DEFAULT '' NOT NULL,
   WART blob DEFAULT '' NOT NULL,
   PRIMARY KEY (SYMBOL),
   UNIQUE SYMBOL (SYMBOL)
   ) type=BerkeleyDB;
 
   then I put some values in it:
 
   INSERT INTO parametry (SYMBOL, WART) VALUES
('Datalic',''),
('Kod',''),
('Kontakt',''),
('Konto',''),
('logo','53'),
('Miasto',''),
('Nazwa',''),
('NazwaW',''),
('NIP',''),
('NIPW',''),
('Ulica','');
 
 then I do:
   select * FROM parametry  WHERE SYMBOL='logo';
 
 and I get:
  ++---+
   | SYMBOL | WART |
  ++---+
   | logo   | @|   |
  ++---+
 
 but if I do
   select * FROM parametry;
 
 and I get:
  ++---+
   | SYMBOL | WART |
  ++---+
   | Datalic   | |
   | Kod  | |
   | Kontakt | |
   | Konto   | |
   | logo   | 53|  - this is correct
 value
   | Miasto   | |
   | Nazwa   | |
   | NazwaW   | |
   | NIP   | |
   | NIPW   | |
   | Ulica  | |
  ++---+
 
 How-To-Repeat:
  code/input/activities to reproduce the problem (multiple lines)
   It happens every time I do it
 Fix:
 
 Submitter-Id: [EMAIL PROTECTED]
 Originator: Sebastian Biniecki
 Organization: TisSoft
  organization of PR author (multiple lines)
 MySQL support: [none | licence | email support | extended email support ]
   nono
 Synopsis: synopsis of the problem (one line)
   select ... from  where ... result bad data with BDB
 Severity: [ non-critical | serious | critical ] (one line)
   serious
 Priority: [ low | medium | high ] (one line)
   high
 Category: mysql
 Class:  [ sw-bug | doc-bug | change-request | support ] (one line)
   sw-bug
 Release: mysql-3.23.33 (Source distribution)
 
 Environment:
 System: Linux mymag.g7.pl 2.2.17-21mdk #1 Thu Oct 5 13:16:08 CEST 2000
 i586
 unknown
 Architecture: i586
 
 Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc
 /usr/bin/cc
 GCC: Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux/2.95.3/specs
 gcc version 2.95.3 19991030 (prerelease)
 Compilation info: CC='gcc'  CFLAGS=''  CXX='c++'  CXXFLAGS=''  LDFLAGS=''
 LIBC:
 lrwxrwxrwx1 root root   13 lut 22 22:05 /lib/libc.so.6 -
 libc-2.1.3.so
 -rwxr-xr-x1 root root   931668 pa  4 18:26 /lib/libc-2.1.3.so
 -rw-r--r--1 root root 20749008 pa  4 18:25 /usr/lib/libc.a
 -rw-r--r--1 root root  178 pa  4 18:25 /usr/lib/libc.so
 Configure command:
 ./configure  --enable-static --prefix=/mysql --with-low-memory
 
 
 
 
 -
 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




RE: Quoting numbers? (was Re:MySQL Tables)

2001-02-22 Thread Julian Strickland

It's all to do with data types, traditionally and across most languages
quotes are used to delimit STRINGS
and a string is NOT a number although may represent one when displayed.

 -Original Message-
 From: Pete Harlan [SMTP:[EMAIL PROTECTED]]
 Sent: 21 February 2001 20:51
 To:   [EMAIL PROTECTED]
 Subject:  Quoting numbers? (was Re:MySQL Tables)
 
  I think you'll get better results if you don't quote your numbers.
 Quotes
  should be used for text and dates (depending) but not numbers.
 
 Out of curiosity, why?
 
 We use quotes for numbers all the time here, for consistency's sake;
 the programmer doesn't have to worry about the representation of, say,
 a salesman_id, but just reads/displays/stores it in the database.
 
 Aside from the fact that leaving them off is possible, is there a
 standards/compatibility/other reason to do so?
 
 (An example of a good reason not to use them would be if the db engine
 weren't smart enough to use an index when you say
 
   select * from table_name where numeric_key = '1234'
 
 but possibly (probably?) all dbms's are that smart.)
 
 --Pete
 
 -
 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




RE: Printed MySQL manual

2001-02-22 Thread Julian Strickland

The distributions come with a text version of the manual so you can download
one and print it yourself
but beware it is rather large.

 -Original Message-
 From: Thalis A. Kalfigopoulos [SMTP:[EMAIL PROTECTED]]
 Sent: 21 February 2001 21:05
 To:   [EMAIL PROTECTED]
 Subject:  Re: Printed MySQL manual
 
  Denis:
  
  I'm not sure you really want a printed MySQL manual ... the software is
  dynamic, and is constantly being upgraded. The online manual is updated
  frequently, and is closer to the software you may be using.
  
  As an alternative, I would suggest one of the fine books on MySQL. Our
  developers each have a copy of the Paul DuBois book ("MySQL" / New
 Riders)
  as well as the O'Reilly book "MySQL  mSQL". Both are excellent learning
 and
  reference resources, and are invaluable in understanding and applying
 SQL
  syntax.
 
 I assume both are pretty good (I can verify that the 2nd one is indeed),
 but still they are begining to show signs of their age. Mysql develops
 very fast and they are both '99 books (IIRC). Does anyone know of any
 plans for 2nd editions?
 
 cheers,
 thalis
 
 
 -
 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




RE: Connecting via MyODBC always brings up the TDX mysql Driver Connect dialog

2001-02-21 Thread Julian Strickland

You could try the Sendkeys command in VB to pre answer the message box

SendKeys {ENTER}, False ' Answer for box before it appears
'if the Wait parameter was true the Answer would go into the sheet cell
'but with it false the Dialog box appears before the Answer is sent

 -Original Message-
 From: Jan R Andersson [SMTP:[EMAIL PROTECTED]]
 Sent: 21 February 2001 15:22
 To:   [EMAIL PROTECTED]
 Subject:  Connecting via MyODBC always brings up the "TDX mysql Driver
 Connect" dialog
 
 Hello,
 
 I've recently successfully downloaded and installed both MySQL and MyODBC
 on
 my Win2000 "box". Everything thing works great, except that for every
 connection via MyODBC I make, the ODBC-setup dialog "TDX mysql Driver
 Connect" pops up and I have to hit its OK button to close it. There is a
 checkbox named "Don't prompt on connect" which I thought was ment to have
 it
 stop poping up that dialog, but it has no effect. Any idea what to do?
 
 Thanks
 
 /Jan R Andersson
 /Kalix
 /Sweden
 
 
 WEB:
 www.jra.nu
 www.mobilesweden.org
 
 WAP:
 jra.nu/main.wml
 wap.mobilesweden.org
 
 
 -
 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




RE: Select Problem

2001-02-15 Thread Julian Strickland

Try rebuilding the indexes.

 -Original Message-
 From: Alaiddin Tayeh [SMTP:[EMAIL PROTECTED]]
 Sent: 15 February 2001 10:34
 To:   [EMAIL PROTECTED]
 Subject:  Select Problem
 
 Linux , Apache, MySQL
 
 I have a problem in my MySQL database, this is the senario:
 I made an update statement on my table by wrong, then I restor my
 backup
 copy by copying the backup files on the exist ones without stopping the
 MySQL.
 Now I have problems in searching data:
 for example when I made select statement using = , no results, but when
 I use %something% I can get the result, this thing not happend with all
 records,
 just some of them.
 any help will be appreciated.
 thanks
 
 
 
 
 
 -
 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




RE: amazingly slow

2001-02-06 Thread Julian Strickland

Try this

SELECT * FROM maintable AS M, wordindex AS YL
 WHERE
YL.Word IN ('billy' , 'bob' , 'john' )
AND
YL3.RecordNumber = M.RecordNumber 
AND
M.Price = 1000
LIMIT 0,50;

Your query is probably slow because you are cubing the size of the wordindex
by invoking it three times

 -Original Message-
 From: Ren Tegel [SMTP:[EMAIL PROTECTED]]
 Sent: 06 February 2001 14:35
 To:   Tim Samshuijzen; [EMAIL PROTECTED]
 Subject:  Re: amazingly slow
 
 Tim,
 
 Hmmm... so you are suggesting the format of the query might be the cause
 of
 this slow response. I find it hard to believe, unless you have a very big
 result set i believe the query should complete within short time.
 
 can you send the output of DESCRIBE db.tablename of all used tables?
 
 regards,
 
 rene
 
 
 
 - Original Message -
 From: "Tim Samshuijzen" [EMAIL PROTECTED]
 To: "Ren Tegel" [EMAIL PROTECTED]
 Sent: Tuesday, February 06, 2001 3:07 PM
 Subject: Re: amazingly slow
 
 
 
 Yep, all requested fields are indexed.
 
 At 02:25 PM 6-2-2001 +0100, you wrote:
 Tim,
 Just kidding about the 513 Mb
 
 you put an index on wordindex.word as well ? (it's not in the table
 description but you use it in your query...Not indexing this field means
 mysql searches whole table for values.. Then your P800 has a reasonable
 performance on such a big table :)) )
 
 regards,
 
 rene
 
 - Original Message -
 From: "Tim Samshuijzen" [EMAIL PROTECTED]
 To: "Ren Tegel" [EMAIL PROTECTED]
 Sent: Tuesday, February 06, 2001 1:58 PM
 Subject: Re: amazingly slow
 
 
 
 
 Dear Ren,
 
 Thanks for your reply.
 
 Oops, the 513 was a typing mistake.
 
 And yes, all the requested fields are indexed.
 
 
 CREATE TABLE wordindex (
WordNumber int(11) NOT NULL,
RecordNumber int(11) NOT NULL,
KEY WordNumber (WordNumber),
KEY RecordNumber (RecordNumber)
 );
 
 CREATE TABLE books (
RecordNumber int(11) NOT NULL auto_increment,
Field1 varchar(60) NOT NULL,
Field2 varchar(60) NOT NULL,
Field3 varchar(60) NOT NULL,
Field4 varchar(60) NOT NULL,
Field5 varchar(60) NOT NULL,
Price bigint(20) unsigned NOT NULL,
PRIMARY KEY (RecordNumber),
KEY Price (Price)
 );
 
 Any suggestions are very welcome.
 
 Tim
 
 At 01:51 PM 6-2-2001 +0100, you wrote:
 Tim,
 
 1. i'd remove 1 Mb from your 513 Mb machine... maybe it's an very old
 edo
 simm or something.
 2. you put an index on all requested fields (maintable.recordnumber and
 wordindex.word) ? I bet not.
 
 
 - Original Message -
 From: "Tim Samshuijzen" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, February 06, 2001 12:04 PM
 Subject: amazingly slow
 
 
 
 
  Hello, I don't understand why my queries are so incredibly slow.
  We have MySQL on a 800MHz Linux machine with 513Mb.
  Most queries look like this:
 
  SELECT B.* FROM maintable AS M, wordindex AS YL1,
 wordindex AS YL2, wordindex AS YL3
  WHERE
YL1.Word = 'billy' AND
YL1.RecordNumber = M.RecordNumber AND
YL2.Word = 'bob' AND
YL2.RecordNumber = M.RecordNumber AND
YL3.Word = 'john' AND
YL3.RecordNumber = M.RecordNumber AND
M.Price = 1000
  LIMIT 0,50;
 
  wordindex is a table that contains all words present in maintable.
  For each word there is a link to maintable through RecordNumber.
 
  This query searches for all records in maintable that contain the
  three words and where it's price is more than 1000.
 
  This query takes more than 20 seconds!
  I hear from others that this query should be returned in a flash!
 
  maintable contains about 900,000 records.
  wordindex contains about 21,000,000 records
 
  All columns are indexed.
 
  Here are my parameters:
 
  key_buffer=256M
  table_cache=256
  sort_buffer=1M
  record_buffer=2M
  join_buffer=4M
  max_sort_length=30
  max_connections=300
 
  I am really desperate. I've been trying everything.
  I've tried the OPTIMIZE TABLE commands, but this also doesn't help.
 
  Anyone out there who wants to save me and our company?
 
  Thanks a lot!
 
  Tim
 
 
 
 
 
 
 
 
  -
  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
 
 
 
 
 
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)

RE: How can I do this ???

2001-02-01 Thread Julian Strickland

This works for me in access

SELECT families.objid, families.name, families.parentid, families_1.objid,
families_1.name, families_1.parentid
FROM families LEFT JOIN families AS families_1 ON families.objid =
families_1.parentid
WHERE ((families.parentid)=0);

 -Original Message-
 From: Johannes Pretorius [SMTP:[EMAIL PROTECTED]]
 Sent: 01 February 2001 15:13
 To:   MySQL
 Subject:  Re: How can I do this ???
 
 
 Yes that is true but what I want to get at is. Like I want to get
 all Childs of the Parents. But NOT the Parents. Meaning if the
 one with a Parent ID is the PARENT then the Others with his ID
 in the Parent_ID field is his children, And I want this to happen
 like create a Treeiew for Instance where all the Parents is shown
 and then all those under them occrding to the Parent ID.
 
 Well I short I am Using Delphi and want to link the tables master source
 with
 each other and if I look at it then then there is no data,
 
 If I run the select
 select * from People where PARENT_ID= OBJID
 
 I get no data. But this must be dynamic. Not a query at a time.
 
 I hope I can make sense for I dont understand mySelf
 but thanks for your time and help
 Johannes
 
 
 
 Rus wrote:
 
  According to your question it could be done as simple as
 
  select * from People where PARENT_ID = 1 or OBJID = 1
 
  :)
 
  - Original Message -
  From: Johannes Pretorius [EMAIL PROTECTED]
  To: MySQL [EMAIL PROTECTED]
  Sent: Thursday, February 01, 2001 4:43 PM
  Subject: How can I do this ???
 
   Hi there
   0---0
   Sorry for stupid Q
   but I have the following Table named People
  
   OBJID - int(11) not null auto_increment
   NAME - varchar(25)
   PARENT_ID - int(11)
  
   Now if my data is as follows
  
   OBJID   | NAME |   PARENT_ID
   ---
1None0
 2   Other1
  
   how can I get the Childs back (those who's Parent_ID is not 0), But
   Linked to a specific
   Parent ID !!.
   Like somehting like this
  
   select * from People where PARENT_ID = OBJID and OBJID = 1
  
   I know the obove wont work but I kinda neet something with that logic.
  
   Thanks In advance for any help
  
   Johannes
  
  
  
  
   -
   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
 
 
 -
 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




RE: How can I do this ???

2001-02-01 Thread Julian Strickland


 Heres the minimal version just to list children
 
 SELECT families_1.name
 FROM families INNER JOIN families AS families_1 ON families.objid =
 families_1.parentid
 WHERE (((families.objid)=1) AND ((families.parentid)=0));
 
 I dont actually use mySQL but am  considering it as an option but this
 code should work on mySQL
 you might not need the AS keywords and you certainly don't need all the
 parenthesis but they shold do no harm.
 
 good luck
 
  -Original Message-
  From:   Johannes Pretorius [SMTP:[EMAIL PROTECTED]]
  Sent:   01 February 2001 15:13
  To: MySQL
  Subject:Re: How can I do this ???
  
  
  Yes that is true but what I want to get at is. Like I want to get
  all Childs of the Parents. But NOT the Parents. Meaning if the
  one with a Parent ID is the PARENT then the Others with his ID
  in the Parent_ID field is his children, And I want this to happen
  like create a Treeiew for Instance where all the Parents is shown
  and then all those under them occrding to the Parent ID.
  
  Well I short I am Using Delphi and want to link the tables master source
  with
  each other and if I look at it then then there is no data,
  
  If I run the select
  select * from People where PARENT_ID= OBJID
  
  I get no data. But this must be dynamic. Not a query at a time.
  
  I hope I can make sense for I dont understand mySelf
  but thanks for your time and help
  Johannes
  
  
  
  Rus wrote:
  
   According to your question it could be done as simple as
  
   select * from People where PARENT_ID = 1 or OBJID = 1
  
   :)
  
   - Original Message -
   From: Johannes Pretorius [EMAIL PROTECTED]
   To: MySQL [EMAIL PROTECTED]
   Sent: Thursday, February 01, 2001 4:43 PM
   Subject: How can I do this ???
  
Hi there
0---0
Sorry for stupid Q
but I have the following Table named People
   
OBJID - int(11) not null auto_increment
NAME - varchar(25)
PARENT_ID - int(11)
   
Now if my data is as follows
   
OBJID   | NAME |   PARENT_ID
---
 1None0
  2   Other1
   
how can I get the Childs back (those who's Parent_ID is not 0), But
Linked to a specific
Parent ID !!.
Like somehting like this
   
select * from People where PARENT_ID = OBJID and OBJID = 1
   
I know the obove wont work but I kinda neet something with that
 logic.
   
Thanks In advance for any help
   
Johannes
   
   
   
   
   
 -
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
  
  
  -
  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

-
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