J
|
Jane 8/10/2007 |
Hi, SELECT posts_table.post_date, posts_table.approved, posts_table.`2` AS JobTitle, posts_table.`5` AS JobDescription, posts_table.`8` AS PostedBy, posts_table.`6` AS JobClassification, posts_table.`13` AS State, posts_table.`14` AS JobType, posts_table.`15` AS Location, categories.category_id, categories.category_name as JobClassification2, categories.category_name as JobDescription2, categories.category_name as JobType2 FROM posts_table Inner Join categories ON (posts_table.`6` = categories.category_id OR posts_table.`5` = categories.category_id OR posts_table.`14` = categories.category_id) |
C
|
Christopher author 8/10/2007 |
Jane, thanks and one problem. Instead of 607 records, I cam getting 1224, and on each record the category columns contain the same value, like Full time Full time Full time and then further down is the same record with Arizona Arizona Arizona. |
F
|
frocco 8/10/2007 |
I think this might work: SELECT
In my main table, I have three separate columns that have a numerical value for their category. A separate table holds the description associated with that number. Essentially I need to join the same column in the category table to three different fields in the main database. I tried this: SELECT posts_table.post_date, posts_table.approved, posts_table.`2` AS JobTitle, posts_table.`5` AS JobDescription, posts_table.`8` AS PostedBy, posts_table.`6` AS JobClassification, posts_table.`13` AS State, posts_table.`14` AS JobType, posts_table.`15` AS Location, categories.category_id, categories.category_name FROM posts_table Inner Join categories ON (posts_table.`6` = categories.category_id OR posts_table.`5` = categories.category_id OR posts_table.`14` = categories.category_id) but only the first field displays the value instead of the number. Greatly appreciate the help I am dead in the water at this point. |
C
|
Christopher author 8/10/2007 |
Frank you are a genius!!!! Thank you so much! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=20329&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' /> |
F
|
frocco 8/10/2007 |
Glad I could help. |