473,718 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help with taking 2 indexes from 1 field

2 New Member
Hi, another newbie. I've been working on a book database, and I'm having problems with books that have multiple authors. My origional database didn't have an index, but I'm now finished making the indexes and converting the authors name in the book database to just the author index #'s. I know how to work when the book only has one author, but not when there's more then one author.

IE.
Database structure:
Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE `books` (
  2.   `ColIndex` smallint(3) unsigned NOT NULL,
  3.   `Vol` tinyint(3) unsigned default NULL,
  4.   `Series` tinytext,
  5.   `Title` tinytext NOT NULL,
  6.   `Author` tinytext NOT NULL,
  7.   `PubYear` tinytext NOT NULL,
  8.   `Publisher` tinytext NOT NULL,
  9.   `ISBN` char(10) NOT NULL,
  10.   `ColStatus` tinytext NOT NULL,
  11.   `BookId` smallint(5) NOT NULL
  12. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Books I own';
Way entry is now:

310, 8, 'Sabrina, the Teenage Witch', 'Salem On Trial', 'Weiss, David Cody, Weiss, Bobbi J. G.', '1998', 'Simon Spotlight Entertainment', '0671017578', 'In Collection', 692

I want it to be:
310, 8, 'Sabrina, the Teenage Witch', 'Salem On Trial', '163, 144', '1998', 'Simon Spotlight Entertainment', '0671017578', 'In Collection', 692


When I use the query:
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM books, authors WHERE ColIndex = 310 AND books.Author = authors.AuthorId
I just get the first author from the list, the second one.

Any help would be appreciated, thanks.
Dec 17 '06 #1
2 1386
ronverdonk
4,258 Recognized Expert Specialist
What is the structure of table 'authors'?

Ronald :cool:
Dec 18 '06 #2
darthyoda6
2 New Member
Sure, It's:

CREATE TABLE `authors` (
`AuthorId` int(11) NOT NULL auto_increment,
`AuthorName` tinytext NOT NULL,
`AuthorSort` tinytext NOT NULL,
`AuthorWeb` tinytext,
PRIMARY KEY (`AuthorId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT= 173 ;
Dec 18 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1781
by: WindAndWaves | last post by:
Hi Everyone Is there anyone who has some sound rules of thumb for using indexes. I see that, for example, access automatically adds them to linked tables, but I feel, they are probably of more use in text fields (for sorting purposes), etc.... Keen to hear your ideas.
2
3305
by: tekanet | last post by:
Hello folks, I'm developing a program that reads an access MDB file and produce some scripts to rebuild the same structure against other databases (MSSQL, MySQL and so on). Reading structure of tables and fields was quite simple. Now I'm stuck because I can't find where to read to access infos about indexes and relationships. Probably for relationships I've to read the hidden table MSysRelationships (I didn't do that 'till now), but I...
6
10766
by: Sparticus | last post by:
I have a database that isn't very big. It has about 2400 rows in it. I try and do an update like this one below (it looks big, but it's really not if you look at it) : UPDATE jobs SET prodduedate = '1/5/2005', clientduedate = '1/5/2005', digitizingcnd = 'x', digitizingcndnonsub = '', digitizingintl = '', retrieval = '', wellsitetape = '', boardsubmissions = '', hardcopylogs = '', burningcd = '', las20 = '', metric = '', tops = '',...
4
1184
by: Darryn Ross | last post by:
Hi, i am trying to run a simple SQL statement from my C# app to return a number of records, however when i do my record count is always zero, but i know there are transactions in there... My code is as follows... "SELECT * FROM " + Table + " WHERE Date >=" + "#" + DateFrom.ToShortDateString() + "#" + " And " + " Date <=" + "#" + DateTo.ToShortDateString() + "#"
8
2637
by: Xu, Wei | last post by:
Hi, I have wrote the following sql sentence.Do you have comments to improve the performance.I have created all the indexed. But it's still very slow.Thanks The primary key is proj_ID and Task_UID. SELECT PR.PROJ_NAME AS PRName, PR.PROJ_ID As PRProjID, PR.TASK_UID As PRTaskUID, 'Dev' AS GroupType, Feat.PROJ_ID As FeatProjID, Feat.TASK_UID As FeatTaskUID, Feat.FeatureID AS FeatureID,
14
19675
by: Jeff | last post by:
This is the first time that I remember ever having too many indexes on a table, but it has happened. I have en employees table and store in many places, on tables, the id of the employee that performed some action. Yes, I know, that could be in an audit trail but it isn't. For example, who printed a sales order, who processed it etc is stored on the sales orders table. Well, I have run out of indexes on the employees table when trying...
10
2698
by: lesperancer | last post by:
you start with a small application in access97, then you have more modules and more... and you reach the point where tables like 'item' and 'employee' reach the limit and you know there's more indexes required for RI to come does creating a RI programatically instead of the relationship window still consume one of the 32 indexes ? does access2000 / 2003 allow more indexes per table ?
0
7597
MMcCarthy
by: MMcCarthy | last post by:
The more data you include in your tables the more you will need to have indexes to search and sort that data. However, there is a balance between having enough indexes and too many. Too many indexes will slow down the speed of updates on your records. Access presets a number of Indexes for you. If you look in Tools ... Options under the Tables/Queries tab you will see that under "Auto Index on Import/Create" there is a list as follows: ...
16
4850
by: Okonita via DBMonster.com | last post by:
Hi all, I am comming along with all this Linus/DB2/scripting business...I am no longer scared of it!! (LOL). But, I need to create a .ksh script that does a REORGCHK and output only tables recommended for reorg. My goal is to reorgchk and run reorgs based on entries in this reorg file as shown in the example below. I have tried my hand at the following failing script and hope that gurus here can throw me a lifeline of examples on how to...
0
9208
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7991
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6654
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5971
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4481
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4743
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3182
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2559
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2123
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.