When I execute the following query I get duplicate product_id's as shown below:
SELECT * FROM product, product_category_xref, category WHERE product_parent_id='' AND product.product_id=product_category_xref.product_id AND category.category_id=product_category_xref.category_id AND product.product_publish='Y' AND product.product_special='Y' ORDER BY product_name DESC\G Results ( As you can see product_id 4139 occurs twice and I desire the product_id's to be unique in this query) I have also included the descriptions of the tables. I would appreciate someone assisting me with a query that works correctly. *************************** 1. row *************************** product_id: 4199 vendor_id: 1 product_parent_id: 0 product_sku: ToBeAs product_s_desc: <b>Coming Soon! Preorder Today!</b><br> A series of essays on the influential thinkers and ideas in modern times. product_desc: <b>Coming Soon! Preorder Today!</b><br> <i>By R.J. Rushdoony</i>. This monumental work is a series of essays on the influential thinkers and ideas in modern times. The author begins with De Sade, who self-consciously broke with any Christian basis for morality and law. Enlightenment thinking began with nature as the only reality, and Christianity was reduced to one option among many. It was then, in turn, attacked as anti-democratic and anti-freedom for its dogmatic assertion of the supernatural. Literary figures such as Shelly, Byron, Whitman, and more are also examined, for the Enlightenment presented both the intellectual and the artist as replacement for the theologian and his church. Ideas, such as the spirit of the age, truth, reason, Romanticism, persona, and Gnosticism are related to the desire to negate God and Christian ethics. Reading this book will help you understand the need to avoid the syncretistic blending of humanistic philosophy with the Christian faith. <p>Paperback, 230 pages, and indices. product_thumb_image: 62c16392f436313324d9922ecf2f5a30.jpg product_full_image: d99c1de85355c6bc853102a4d85065b3.jpg product_publish: Y product_weight: 0.0000 product_weight_uom: pounds product_length: 0.0000 product_width: 0.0000 product_height: 0.0000 product_lwh_uom: inches product_url: product_in_stock: 0 product_available_date: 0 product_special: y product_discount_id: 0 ship_code_id: NULL cdate: 1057785021 mdate: 1059273555 product_name: To Be As God: A Study of Modern Thought Since the Marquis De Sade product_discount_use: category_id: 7920cfab5c630ca88ceabcfda6b3848d product_id: 4199 product_list: NULL category_id: 7920cfab5c630ca88ceabcfda6b3848d vendor_id: 1 category_name: BOOKS category_description: category_thumb_image: NULL category_full_image: NULL category_publish: Y menu_image_1: menu_image_2: menu_image_3: page_image: cdate: 1028759226 mdate: 1028759226 category_flypage: category_browsepage: *************************** 2. row *************************** product_id: 4139 vendor_id: 1 product_parent_id: 0 product_sku: Victims product_s_desc: The decline of Americas public education - how and why. product_desc: <i>By Samuel L. Blumenfeld.</i> Americas most effective critic of public education shows us how Americas public schools were remade by educators who used curriculum to create citizens suitable for their own vision of a utopian socialist society. This collection of essays will show you how and why Americas public education declined. You will see the educator-engineered decline of reading skills. The author describes the causes for the decline and the way back to competent education methodologies that will result in a self-educated, competent, and freedom-loving populace. <p>Paperback, 266 pages, and index. product_thumb_image: 63ad73b92ddd18d83eb6942914bcf277.jpg product_full_image: 1440c376576aba8783f183ff145c248b.jpg product_publish: Y product_weight: 0.0000 product_weight_uom: pounds product_length: 0.0000 product_width: 0.0000 product_height: 0.0000 product_lwh_uom: inches product_url: product_in_stock: 0 product_available_date: 0 product_special: y product_discount_id: 0 ship_code_id: NULL cdate: 1056405288 mdate: 1061947639 product_name: The Victims of Dick and Jane product_discount_use: category_id: 7920cfab5c630ca88ceabcfda6b3848d product_id: 4139 product_list: NULL category_id: 7920cfab5c630ca88ceabcfda6b3848d vendor_id: 1 category_name: BOOKS category_description: category_thumb_image: NULL category_full_image: NULL category_publish: Y menu_image_1: menu_image_2: menu_image_3: page_image: cdate: 1028759226 mdate: 1028759226 category_flypage: category_browsepage: *************************** 3. row *************************** product_id: 4139 vendor_id: 1 product_parent_id: 0 product_sku: Victims product_s_desc: The decline of Americas public education - how and why. product_desc: <i>By Samuel L. Blumenfeld.</i> Americas most effective critic of public education shows us how Americas public schools were remade by educators who used curriculum to create citizens suitable for their own vision of a utopian socialist society. This collection of essays will show you how and why Americas public education declined. You will see the educator-engineered decline of reading skills. The author describes the causes for the decline and the way back to competent education methodologies that will result in a self-educated, competent, and freedom-loving populace. <p>Paperback, 266 pages, and index. product_thumb_image: 63ad73b92ddd18d83eb6942914bcf277.jpg product_full_image: 1440c376576aba8783f183ff145c248b.jpg product_publish: Y product_weight: 0.0000 product_weight_uom: pounds product_length: 0.0000 product_width: 0.0000 product_height: 0.0000 product_lwh_uom: inches product_url: product_in_stock: 0 product_available_date: 0 product_special: y product_discount_id: 0 ship_code_id: NULL cdate: 1056405288 mdate: 1061947639 product_name: The Victims of Dick and Jane product_discount_use: category_id: 4ee8c8513ee84c95c8eb7f24e63d7222 product_id: 4139 product_list: NULL category_id: 4ee8c8513ee84c95c8eb7f24e63d7222 vendor_id: 1 category_name: EDUCATION category_description: category_thumb_image: NULL category_full_image: NULL category_publish: Y menu_image_1: menu_image_2: menu_image_3: page_image: cdate: 1057789312 mdate: 1057912000 category_flypage: category_browsepage: *************************** 4. row *************************** product_id: 4203 vendor_id: 1 product_parent_id: 0 product_sku: Predestination product_s_desc: A thorough presentation of the Biblical doctrine of absolute predestination from both the dogmatic and systematic perspectives product_desc: <i>John B.King,Jr.</i> This book is a thorough presentation of the Biblical doctrine of absolute predestination from both the dogmatic and systematic perspectives. The author defends predestination from the perspective of Martin Luther, showing he was as vigorously predestinarian as John Calvin. At the same time, the author provides a compellingly systematic theological understanding of predestination. This book will give the reader a fuller understanding of the sovereignty of God. <p>Paperback, 314 pages. product_thumb_image: 6634b42b7ccc92374678a88c3a09aa97.jpg product_full_image: 30064075afe34c988fb2b1eaa45bc792.jpg product_publish: Y product_weight: 0.0000 product_weight_uom: pounds product_length: 0.0000 product_width: 0.0000 product_height: 0.0000 product_lwh_uom: inches product_url: product_in_stock: 0 product_available_date: 0 product_special: y product_discount_id: 0 ship_code_id: NULL cdate: 1057786440 mdate: 1059272667 product_name: Predestination in Light of the Cross product_discount_use: category_id: 7920cfab5c630ca88ceabcfda6b3848d product_id: 4203 product_list: NULL category_id: 7920cfab5c630ca88ceabcfda6b3848d vendor_id: 1 category_name: BOOKS category_description: category_thumb_image: NULL category_full_image: NULL category_publish: Y menu_image_1: menu_image_2: menu_image_3: page_image: cdate: 1028759226 mdate: 1028759226 category_flypage: category_browsepage: *************************** 5. row *************************** product_id: 4198 vendor_id: 1 product_parent_id: 0 product_sku: Larceny product_s_desc: Why envy often causes the most successful and advanced members of society to be deemed criminals. product_desc: <i>By R.J. Rushdoony</i>. In this study, first published under the title <i>Roots of Inflation</i>, the reader sees why envy often causes the most successful and advanced members of society to be deemed criminals. The reader is shown how envious man finds any superiority in others intolerable and how this leads to a desire for a leveling. The author uncovers the larceny in the heart of man and its results. See how class warfare and a social order based on conflict lead to disaster. This book is essential reading for an understanding of the moral crisis of modern economics and the only certain long-term cure. <p>Paperback, 144 pages, and indices. product_thumb_image: 6cfdc53945690208d4b588e759c72d07.jpg product_full_image: 00c9b58c78f14128daceb9fffa846016.jpg product_publish: Y product_weight: 0.0000 product_weight_uom: pounds product_length: 0.0000 product_width: 0.0000 product_height: 0.0000 product_lwh_uom: inches product_url: product_in_stock: 0 product_available_date: 0 product_special: Y product_discount_id: 0 ship_code_id: NULL cdate: 1057783755 mdate: 1057909848 product_name: Larceny in the Heart: The Economics of Satan and the Inflationary State product_discount_use: category_id: 7920cfab5c630ca88ceabcfda6b3848d product_id: 4198 product_list: NULL category_id: 7920cfab5c630ca88ceabcfda6b3848d vendor_id: 1 category_name: BOOKS category_description: category_thumb_image: NULL category_full_image: NULL category_publish: Y menu_image_1: menu_image_2: menu_image_3: page_image: cdate: 1028759226 mdate: 1028759226 category_flypage: category_browsepage: *************************** 6. row *************************** product_id: 4196 vendor_id: 1 product_parent_id: 0 product_sku: Chariots product_s_desc: See how the modern Christian is again guilty of Baal-worship, of how inflation-fed prosperity caused a loosening of morals, syncretism and a decline in educational performance. product_desc: <i>By R.J.Rushdoony</i>.See how close Israels religious failure resembles our own! Read this to see how the modern Christian is again guilty of Baal worship, of how inflation-fed prosperity caused a loosening of morals,syncretism and a decline in educational performance. As in the days of Elijah and Elisha, it is once again said to be a virtue to tolerate evil and condemn those who do not. This book will challenge you to resist compromise and the temptation of expediency. It will help you take a stand by faith for God s truth in a culture of falsehoods. <p>Hardback,163 pages, with indices. product_thumb_image: bf18941008cd6fb7ac36ac575997dbdd.jpg product_full_image: 85d48e46af9aa9e9f9375a203ae44b2f.jpg product_publish: Y product_weight: 0.0000 product_weight_uom: pounds product_length: 0.0000 product_width: 0.0000 product_height: 0.0000 product_lwh_uom: inches product_url: product_in_stock: 0 product_available_date: 0 product_special: Y product_discount_id: 0 ship_code_id: NULL cdate: 1057782469 mdate: 1057909823 product_name: Chariots of Prophetic Fire: Studies in Elijah and Elisha product_discount_use: category_id: 7920cfab5c630ca88ceabcfda6b3848d product_id: 4196 product_list: NULL category_id: 7920cfab5c630ca88ceabcfda6b3848d vendor_id: 1 category_name: BOOKS category_description: category_thumb_image: NULL category_full_image: NULL category_publish: Y menu_image_1: menu_image_2: menu_image_3: page_image: cdate: 1028759226 mdate: 1028759226 category_flypage: category_browsepage: *************************** 7. row *************************** product_id: 4200 vendor_id: 1 product_parent_id: 0 product_sku: ConqueringFaith product_s_desc: <b>Coming Soon! Preorder Today!</b><br> This monograph takes on the doctrinal defection of today's church by providing Christians with an introductory treatment of important areas of Christian doctrine. product_desc: <b>Coming Soon! Preorder Today!</b><br><i>By William O. Einwechter</i>. This monograph takes on the doctrinal defection of today's church by providing Christians with an introductory treatment of six vital areas of Christian doctrine: God s sovereignty, Christs Lordship, Gods law, the authority of Scripture, the dominion mandate, and the victory of Christ and His church in history. This easy-to-read booklet is a welcome antidote to the humanistic theology of the 21st century church. <p>Booklet, 44 pages. product_thumb_image: 12e69847e4e653fc140d21f383eecf58.jpg product_full_image: efb2a5ef7dc3a7d3677c774c838a5918.jpg product_publish: Y product_weight: 0.0000 product_weight_uom: pounds product_length: 0.0000 product_width: 0.0000 product_height: 0.0000 product_lwh_uom: inches product_url: product_in_stock: 0 product_available_date: 0 product_special: Y product_discount_id: 0 ship_code_id: NULL cdate: 1057785592 mdate: 1059174550 product_name: A Conquering Faith product_discount_use: category_id: 7920cfab5c630ca88ceabcfda6b3848d product_id: 4200 product_list: NULL category_id: 7920cfab5c630ca88ceabcfda6b3848d vendor_id: 1 category_name: BOOKS category_description: category_thumb_image: NULL category_full_image: NULL category_publish: Y menu_image_1: menu_image_2: menu_image_3: page_image: cdate: 1028759226 mdate: 1028759226 category_flypage: category_browsepage: *************************** 8. row *************************** product_id: 4225 vendor_id: 1 product_parent_id: 0 product_sku: wset product_s_desc: <font color=CC000000><b>Currently on sale through August 31st.</b></font> Twelve taped lessons give an overview of history from ancient times to the 20th century as only Rev. Rushdoony could. product_desc: <i>By R.J. Rushdoony</i>. 12 cassettes with notes, questions, and answer key in an attractive album. <i>From tape 3:</i> "Can you see why a knowledge of history is importantso that we can see the issues as our Lord presented them against the whole backboard of history and to see the battle as it is again lining up?Because again we have the tragic view of ancient Greece; again we have the Persian viewtolerate both good and evil; again we have the Assyrian-Babylonian-Egyptian view of chaos as the source of regeneration. And we must therefore again find our personal and societal regeneration in Jesus Christ and His Word all things must be made new in terms of His Word." <p>Twelve taped lessons give an overview of history from ancient times to the 20th century as only Rev. Rushdoony could. Text includes fifteen chapters of class notes covering ancient history through the Reformation.Text also includes review questions covering the tapes and questions for thought and discussion. Album includes 12 tapes,notes,and answer key. <p>12 tapes in album, Set of A Christian Survey of World History."<br> <table><tr valign="top"><td><b>Tape 1</b></td><td>1. Time and History: Why History is Important</td></tr><tr valign="top"><td><b>Tape 2</b></td><td>2. Israel,Egypt, and the Ancient Near East</td></tr><tr valign="top"><td><b>Tape 3</b></td><td>3. Assyria,Babylon,Persia,Greece and Jesus Christ</td></tr><tr valign="top"><td><b>Tape 4</b></td><td>4. The Roman Republic and Empire</td></tr><tr valign="top"><td><b>Tape 5</b></td><td>5. The Early Church<br>6. Byzantium</td></tr><tr valign="top"><td><b>Tape 6</b></td><td> 7. Islam<br>8. The Frontier Age</td></tr><tr valign="top"><td><b>Tape 7</b></td><td>9. New Humanism or Medieval Period</td></tr><tr valign="top"><td><b>Tape 8</b></td><td>10. The Reformation</td></tr><tr valign="top"><td><b>Tape 9</b></td><td>11. Wars of Religion So Called<br>12. The Thirty Years War</td></tr><tr valign="top"><td><b>Tape 10</b></td><td>13. France:Louis XIV through Napoleon</td></tr><tr valign="top"><td><b>Tape 11</b></td><td>14. England:The Puritans through Queen Victoria</td></tr><tr valign="top"><td><b>Tape 12</b></td><td>15. 20th Century: The Intellectual Scientific Elite</td></tr></table> <p><font color=#CC0000><b>On sale through July 31st.</b></font> product_thumb_image: a64b190bbed73924e6b18a1da00ea370.jpg product_full_image: 412e16d7686b4f3a182a6abaff69f813.jpg product_publish: Y product_weight: 0.0000 product_weight_uom: pounds product_length: 0.0000 product_width: 0.0000 product_height: 0.0000 product_lwh_uom: inches product_url: product_in_stock: 0 product_available_date: 0 product_special: Y product_discount_id: 0 ship_code_id: NULL cdate: 1057797829 mdate: 1060810970 product_name: A Christian Survey of World History (12 tapes) product_discount_use: category_id: 25fedf73a6b819fd0b06c48ad81c4542 product_id: 4225 product_list: NULL category_id: 25fedf73a6b819fd0b06c48ad81c4542 vendor_id: 1 category_name: WORLD HISTORY category_description: category_thumb_image: NULL category_full_image: NULL category_publish: Y menu_image_1: menu_image_2: menu_image_3: page_image: cdate: 1057796988 mdate: 1057912017 category_flypage: category_browsepage: 8 rows in set (0.03 sec) mysql> describe product; +------------------------+---------------+------+-----+---------+----------- -----+ | Field | Type | Null | Key | Default | Extra | +------------------------+---------------+------+-----+---------+----------- -----+ | product_id | int(11) | | PRI | NULL | auto_increment | | vendor_id | int(11) | | | 0 | | | product_parent_id | int(11) | YES | | NULL | | | product_sku | varchar(64) | | | | | | product_s_desc | text | YES | | NULL | | | product_desc | text | YES | | NULL | | | product_thumb_image | varchar(255) | YES | | NULL | | | product_full_image | varchar(255) | YES | | NULL | | | product_publish | char(1) | YES | | NULL | | | product_weight | decimal(10,4) | YES | | NULL | | | product_weight_uom | varchar(32) | YES | | pounds. | | | product_length | decimal(10,4) | YES | | NULL | | | product_width | decimal(10,4) | YES | | NULL | | | product_height | decimal(10,4) | YES | | NULL | | | product_lwh_uom | varchar(32) | YES | | inches | | | product_url | varchar(255) | YES | | NULL | | | product_in_stock | int(11) | YES | | NULL | | | product_available_date | int(11) | YES | | NULL | | | product_special | char(1) | YES | | NULL | | | product_discount_id | int(11) | YES | | NULL | | | ship_code_id | int(11) | YES | | NULL | | | cdate | int(11) | YES | | NULL | | | mdate | int(11) | YES | | NULL | | | product_name | varchar(128) | YES | | NULL | | | product_discount_use | char(1) | | | | | +------------------------+---------------+------+-----+---------+----------- -----+ 25 rows in set (0.00 sec) mysql> describe product_category_xref; +--------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------+-------------+------+-----+---------+-------+ | category_id | varchar(32) | YES | | NULL | | | product_id | int(11) | | | 0 | | | product_list | int(11) | YES | | NULL | | +--------------+-------------+------+-----+---------+-------+ 3 rows in set (0.00 sec) mysql> describe category; +----------------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------------------+--------------+------+-----+---------+-------+ | category_id | varchar(32) | | PRI | | | | vendor_id | int(11) | | | 0 | | | category_name | varchar(128) | | | | | | category_description | text | YES | | NULL | | | category_thumb_image | varchar(255) | YES | | NULL | | | category_full_image | varchar(255) | YES | | NULL | | | category_publish | char(1) | YES | | NULL | | | menu_image_1 | varchar(255) | | | | | | menu_image_2 | varchar(255) | | | | | | menu_image_3 | varchar(255) | | | | | | page_image | varchar(255) | | | | | | cdate | int(11) | YES | | NULL | | | mdate | int(11) | YES | | NULL | | | category_flypage | varchar(255) | YES | | NULL | | | category_browsepage | varchar(255) | | | | | +----------------------+--------------+------+-----+---------+-------+ 15 rows in set (0.00 sec) Thank You Paul -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]