RE: ID in table
It's messy but you can also insert x rows, then delete x rows and the next row inserted will have id x+1 assuming that you started with 0 rows. -- Peter Dunham Ellipse Media t. +44 (0)20 8656 0950 --- -Original Message- From: Mike Grabski [mailto:[EMAIL PROTECTED]] Sent: 17 January 2002 21:24 To: 'Jure Grom' Cc: MySQL - List Subject: RE: ID in table I believe auto_increment uses the last highest value inserted into the record. So if your first insert is 1000, it will count up from 1000 there on after. Correct me if wrong. Mike -Original Message- From: Jure Grom [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 17, 2002 3:56 PM To: MySQL - List Subject: ID in table Is there any way to start Ids in table from some number for exampl 1 with function auto_increment and not from 1? tnx jure - 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
MATCH vs LIKE
I am trying to speed up keyword searches using MATCH AGAINST instead of like, but am getting unexpected results. I had assumed that using 'WHERE MATCH fulltext(column.name) AGAINST 'searchterm' would produce the same results as 'WHERE column.name LIKE '%searchterm%' but it doesn't seem to. Actual queries: First one returns 190 rows using: SELECT affiliates.id, affiliates.site_name,affiliates.site_desc,affiliates.company FROM affiliates WHERE MATCH (affiliates.site_desc,affiliates.site_name,affiliates.company) AGAINST ('shop'); Second one returns 1168 rows using: SELECT affiliates.id, affiliates.site_name,affiliates.site_desc,affiliates.company FROM affiliates WHERE affiliates.site_name like '%shop%' OR affiliates.site_desc like '%shop%' OR affiliates.company like '%shop%'; This is the index: mysql show index from affiliates; ++++--+-+--- +-+--++--+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Comment | ++++--+-+--- +-+--++--+ | affiliates | 0 | PRIMARY|1 | id | A |9019 | NULL | NULL | | | affiliates | 0 | id |1 | id | A |9019 | NULL | NULL | | | affiliates | 1 | SEARCHTEXT |1 | site_desc | A |NULL |1 | NULL | FULLTEXT | | affiliates | 1 | SEARCHTEXT |2 | site_name | A |NULL | NULL | NULL | FULLTEXT | | affiliates | 1 | SEARCHTEXT |3 | company | A |NULL | NULL | NULL | FULLTEXT | ++++--+-+--- +-+--++--+ 5 rows in set (0.00 sec) This is the table: mysql show columns from affiliates; +---+--+--+-+-++ | Field | Type | Null | Key | Default | Extra | +---+--+--+-+-++ | id| int(20) | | PRI | NULL| auto_increment | | contact_name | varchar(100) | | | || | company | varchar(75) | YES | | NULL|| | address_1 | varchar(100) | YES | | NULL|| | address_2 | varchar(100) | YES | | NULL|| | city | varchar(25) | YES | | NULL|| | county| varchar(25) | YES | | NULL|| | post_code | varchar(12) | YES | | NULL|| | country | varchar(25) | YES | | NULL|| | email | varchar(75) | | | || | telephone | varchar(20) | YES | | NULL|| | cheques | varchar(75) | YES | | NULL|| | vat_reg | char(1) | YES | | 0 || | vat_type | char(1) | YES | | NULL|| | vat_no| varchar(13) | YES | | NULL|| | site_name | varchar(75) | | | || | URL | varchar(150) | YES | | NULL|| | site_desc | text | YES | MUL | NULL|| | primary_content | varchar(20) | YES | | NULL|| | secondary_content | varchar(20) | YES | | NULL|| | password | varchar(20) | | | || | refered | int(11) | YES | | NULL|| | timestamp | datetime | YES | | NULL|| | confirmed | tinyint(1) | YES | | 0 || | active| tinyint(1) | YES | | 1 || | confirmcode | varchar(25) | YES | | NULL|| | signup_ip | varchar(15) | YES | | NULL|| | email_list| tinyint(1) | YES | | 1 || +---+--+--+-+-++ 28 rows in set (0.00 sec) Any thoughts please? --- Peter Dunham www.affiliatewindow.com the future of web marketing --- - 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
RE: ROW ID
You need to specify an 'id' column when creating the table; there is no 'hidden' one. --- Peter Dunham www.affiliatewindow.com the future of web marketing --- -Original Message- From: Ing. Gustavo Edelstein [mailto:[EMAIL PROTECTED]] Sent: 14 January 2002 16:58 To: Rick Emery; [EMAIL PROTECTED] Subject: Re: ROW ID What I mean is to get the internal id of every existing row in a table. Thanks. Ing. Gustavo A. Edelstein Tech. Mgr. Equiplus Argentina S.A. __ Visit us On Line at www.equiplus.com Email addresses: Operations: [EMAIL PROTECTED] Consulting: [EMAIL PROTECTED] Technical: [EMAIL PROTECTED] Web related: [EMAIL PROTECTED] General: [EMAIL PROTECTED] - Original Message - From: Rick Emery [EMAIL PROTECTED] To: 'Ing. Gustavo Edelstein' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, January 14, 2002 1:27 PM Subject: RE: ROW ID If the value was set with AUTO_INCREMENT, then immediately after inserting the row, do: SELECT last_insert_id() AS myvalue; -Original Message- From: Ing. Gustavo Edelstein [mailto:[EMAIL PROTECTED]] Sent: Monday, January 14, 2002 10:03 AM To: [EMAIL PROTECTED] Subject: ROW ID Hi list members, How to get the unique row id for a row in a table ? Thanks. Ing. Gustavo A. Edelstein Tech. Mgr. Equiplus Argentina S.A. __ Visit us On Line at www.equiplus.com Email addresses: Operations: [EMAIL PROTECTED] Consulting: [EMAIL PROTECTED] Technical: [EMAIL PROTECTED] Web related: [EMAIL PROTECTED] General: [EMAIL PROTECTED] - 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