Note that there are some explanatory texts on larger screens.

plurals
  1. POhelp me resolve this query to insert entries in tables
    primarykey
    data
    text
    <p>I am working backwards with a query. I have a select query that fetches some rows...but now I am working backwards and want to insert entries in concerned tables to that the select query brings back the stuff I inserted. </p> <p>Select Query:</p> <pre><code>SELECT DISTINCT a.catalogID, a.topicID, a.topicShortName FROM catalog_lu_topics a LEFT JOIN catalog b ON a.catalogID = b.catalogID LEFT JOIN catalog_topics d ON ( a.topicID = d.topicID AND d.topicID != 'top295' ) LEFT JOIN catalog_topics e ON ( ( d.catalogID = e.catalogID ) AND ( e.topicID != d.topicID ) ) LEFT JOIN catalog_lu_topics f ON f.topicID = e.topicID WHERE a.displayStatus != 'hide' AND f.parentID = 'top305' </code></pre> <p>I've inserted entries in the following tables: </p> <pre><code>catalog catalog_lu_topics (made sure that parentID = 'top305') catalog_topics (made sure topicid is not top295) catalog_topics (additional entry, with different topicID) </code></pre> <p>After the insert statements if I run the above query again, i do not see the new entries. But If I remove the following entries from the above select query then I see the new entries:</p> <pre><code>AND ( e.topicID != d.topicID ) </code></pre> <p>I cant wrap my head around this and need some advice. </p> <p>EDIT: result of select a.* e.topicid, d.topicid (after adding new entries). Note new entries do not show up in this resultset</p> <pre><code>top335 114 Victorian Grace top301 5 gvl107 Desc display 2007-03-26 12:38:46 top318 top335 top329 34 Revived Georgian top301 2 gvl107 Desc display 2007-03-26 12:38:46 top318 top329 top338 117 DC Townhouse top301 4 gvl107 Desc display 2007-03-26 12:38:47 top318 top338 top329 34 Revived Georgian top301 2 gvl107 Desc display 2007-03-26 12:38:46 top316 top329 top336 115 Bespoke in Bethesda top301 6 gvl107 Desc display 2007-03-26 12:38:46 top316 top336 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload