<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SELECT DISTINCT, ORDER BY expressions in Studio content view query? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/select-distinct-order-by-expressions-in-studio-content-view/m-p/313038#M39</link>
    <description>&lt;P&gt;Yes, I am using PostgreSQL, single instance.&lt;/P&gt;</description>
    <pubDate>Fri, 30 Dec 2011 15:55:51 GMT</pubDate>
    <dc:creator>karl_harris_</dc:creator>
    <dc:date>2011-12-30T15:55:51Z</dc:date>
    <item>
      <title>SELECT DISTINCT, ORDER BY expressions in Studio content view query?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/select-distinct-order-by-expressions-in-studio-content-view/m-p/313036#M37</link>
      <description>&lt;P&gt;I'm using the following query for a content view using Studio:&lt;/P&gt;
&lt;P&gt;ecm:mixinType != 'HiddenInNavigation' AND ecm:isCheckedInVersion = 0 AND ecm:currentLifeCycleState != 'deleted' AND zdoctype:ztype ILIKE 'zaxis_customer' AND ZCUSTII:Contact/*/ContactEmail ILIKE '%ZC1236%'&lt;/P&gt;
&lt;P&gt;The Contact field is a complex list within which one of the fields is ContactEmail and I'm trying to search for the ZC1236 pattern and list all the documents which contain that email pattern.&lt;/P&gt;
&lt;P&gt;When executed I get the following error:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;SELECT DISTINCT, ORDER BY expressions must appear in select list.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It seems I do not have control, in Studio, with where the SELECT DISTINCT AND ORDER BY expression appear in the query.&lt;/P&gt;
&lt;P&gt;Can this type of query work in studio content view?&lt;/P&gt;
&lt;P&gt;The following query works in nuxeo shell:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;Select * FROM Customer Where ( ecm:mixinType != 'HiddenInNavigation' AND ecm:isCheckedInVersion = 0 AND ecm:currentLifeCycleState != 'deleted' AND ZCUSTII:Contact/*/ContactEmail ILIKE '%ZC1236%')
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Ultimately I'd like to take an email address and query the customer documents for a match then relate that email to the customer document.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2011 17:37:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/select-distinct-order-by-expressions-in-studio-content-view/m-p/313036#M37</guid>
      <dc:creator>karl_harris_</dc:creator>
      <dc:date>2011-12-29T17:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT DISTINCT, ORDER BY expressions in Studio content view query?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/select-distinct-order-by-expressions-in-studio-content-view/m-p/313037#M38</link>
      <description>&lt;P&gt;Your error message seems to be coming from the database (PostgreSQL?), not from NXQL. In that light, the results of your tests with the Nuxeo Shell seem confusing to me. It might sound like a naive question but are you performing both tests against the same running Nuxeo instance?&lt;/P&gt;
&lt;P&gt;Also, reading from your description I am not sure you need this syntax for your specific scenario:&lt;/P&gt;
&lt;PRE&gt;ZCUSTII:Contact/*/ContactEmail&lt;/PRE&gt;
&lt;P&gt;Could you try to replace the above fragment with the following instead and let us know about the results? :&lt;/P&gt;
&lt;PRE&gt;ZCUSTII:Contact/ContactEmail&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Dec 2011 23:04:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/select-distinct-order-by-expressions-in-studio-content-view/m-p/313037#M38</guid>
      <dc:creator>Wojciech_Sulejm</dc:creator>
      <dc:date>2011-12-29T23:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT DISTINCT, ORDER BY expressions in Studio content view query?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/select-distinct-order-by-expressions-in-studio-content-view/m-p/313038#M39</link>
      <description>&lt;P&gt;Yes, I am using PostgreSQL, single instance.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2011 15:55:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/select-distinct-order-by-expressions-in-studio-content-view/m-p/313038#M39</guid>
      <dc:creator>karl_harris_</dc:creator>
      <dc:date>2011-12-30T15:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT DISTINCT, ORDER BY expressions in Studio content view query?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/select-distinct-order-by-expressions-in-studio-content-view/m-p/313039#M40</link>
      <description>&lt;P&gt;Could you try matching both queries in both systems?&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2011 16:38:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/select-distinct-order-by-expressions-in-studio-content-view/m-p/313039#M40</guid>
      <dc:creator>Wojciech_Sulejm</dc:creator>
      <dc:date>2011-12-30T16:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT DISTINCT, ORDER BY expressions in Studio content view query?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/select-distinct-order-by-expressions-in-studio-content-view/m-p/313040#M41</link>
      <description>&lt;P&gt;After I removed the suggested fragment, in Studio, I got the following error&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2011 18:16:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/select-distinct-order-by-expressions-in-studio-content-view/m-p/313040#M41</guid>
      <dc:creator>karl_harris_</dc:creator>
      <dc:date>2011-12-30T18:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT DISTINCT, ORDER BY expressions in Studio content view query?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/select-distinct-order-by-expressions-in-studio-content-view/m-p/313041#M42</link>
      <description>&lt;P&gt;Unrelated note&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2012 15:21:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/select-distinct-order-by-expressions-in-studio-content-view/m-p/313041#M42</guid>
      <dc:creator>Florent_Guillau</dc:creator>
      <dc:date>2012-01-02T15:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT DISTINCT, ORDER BY expressions in Studio content view query?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/select-distinct-order-by-expressions-in-studio-content-view/m-p/313042#M43</link>
      <description>&lt;P&gt;The message comes from Nuxeo, see &lt;A href="http://jira.nuxeo.com/browse/NXP-8001"&gt;here&lt;/A&gt;. Indeed it seems that the content view generates a query with either an explicit DISTINCT or explicit columns but not the one from the ORDER BY. Could you include the XML for your content view? Or debug to see what NXQL query is sent? Ultimately it's likely a bug, so opening a new NXP and copy the URL into an answer to this question would be a good move.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2012 15:30:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/select-distinct-order-by-expressions-in-studio-content-view/m-p/313042#M43</guid>
      <dc:creator>Florent_Guillau</dc:creator>
      <dc:date>2012-01-02T15:30:31Z</dc:date>
    </item>
  </channel>
</rss>

