Finding the number, occurring odd number of times in an array

Given an array arr[] of n integers, find a number which occurred odd times in the array. If such an element exists, print that respective element, else print There is no odd occurring element.

Note: The array should contain at most one odd times occurring number.

Method 1 ( Hashing ):

Approach: Create an empty hash table. Copy the input array elements into the HashMap such that it contains key as element and value as frequency( count of occurrences ) of that element. Now traverse the HashMap and check for the odd occurrence using divisibility test. If found, print the element.

For example:

doc1

In the above example, the input elements {2, 3, 10, 5, 2, 10, 10, 5, 3}  are mapped into a hash table with keys {2, 3, 5, 10} with respective values {2, 2, 2, 3}.

When HashMap is traversed from the beginning, the odd occurred element (here 10) can be found with a divisibility test(by 2).

Complexity Analysis : Time Complexity : O(n)   Space Complexity: O(n)

{tab title="C++" class="green"}

/* The code is contributed by Tangudu Sai Kiran. */
//A C++ program to find the odd times occurring element from a given input array using Hashing
#include <bits/stdc++.h>
using namespace std;

//Function to find element which occurred odd number of times	
void findOccurance(int n, int arr[])
{
    //Defining a HashMap
    unordered_map<int, int> elements;  
        
    //Inserting elements into the Hashmap
    for(int i = 0; i < n; i++)
           elements[arr[i]]++;
	 
     //Iterate through the hashmap to find odd occurring element if exists
     for(auto it : elements)
     {
	    //checking for majority condition
          if(it.second % 2 != 0){
              cout<<"ODD OCCURRING ELEMENT: "<< it.first<< endl;
              return;
          }
      }
      cout<<"THERE IS NO ODD OCCURRING ELEMENT"<<endl;
	return;
}
int main()
{
    int arr[] = {6, 5, 2, 5, 4, 2, 6};
    int n = sizeof(arr) / sizeof(arr[0]);
    //Function call
    findOccurance(n, arr);
    return 0;
}

{tab title="Java" class="orange"}

/* The code is contributed by Tammisetti Naveen */
//A JAVA program to find odd times occurring number using Hashing
import java.util.HashMap;
public class OddOccurrenceElement 
{
	//function to find the element which occurs odd no of times
	static void FindOccurence (int n, int arr[])	{
		HashMap<Integer,Integer> Hsmap = new HashMap<Integer, Integer>();
		for (int i = 0; i < n; i++)
		{
			//if the key is repeated, its value is incremented else element is added and its frequency is 1
			if (Hsmap.containsKey(arr[i]))
			{
				Hsmap.put (arr[i], Hsmap.get(arr[i]) + 1);
			}
			else
			{
				Hsmap.put(arr[i], 1);
			}
		}
		for (int i = 0;i < n; i++)
		{
			if(Hsmap.get(arr[i]) % 2 != 0)
			{
				System.out.print (arr[i]);
				return;
			}
		}
		System.out.println ("THERE IS NO NUMBER OCCURRING ODD NUMBER OF TIMES");
	}
	
	public static void main(String args[])
	{
		int arr[] = {6, 5, 2, 5, 4, 2, 6};
		int n = arr.length;
		//Function call
		FindOccurence(n, arr);
	}
}

{tab title="Python" class="red"}


//Hashing method to find which occurrence odd number of times
def findOddOccurence(array):
    d=dict()#to store key:value pairs
    for i in array:
        if i in d:
            d[i]+=1   #if element is present then increment its value by 1
        else:
            d[i]=1    #if element not present then initialize its value to 1
    for j in d.keys():
        if d[j]%2!=0:
            print('THE NUMBER OCCURRING ODD TIMES:', j)
            return
    print('THERE IS NO NUMBER OCCURRING ODD NUMBER OF TIMES')

if __name__=="__main__":
    array=[6, 5, 2, 5, 4, 2, 6]
    findOddOccurence(array)

{/tabs}

Method 2 ( Using XOR)

This is the most effective and efficient algorithm to find an odd occurring element from a given array. It uses two basic properties of XOR: Self-inverse and Identity properties which mean-Any element XORed with itself gives zero(A ⊕ A = 0) and any element XOR’d with zero left unchanged (A ⊕ 0 = A) respectively.

Approach:  Initialize a variable( say result ) to 0. Traverse the array from the beginning and Compute XOR of each and every element with the result variable. So outputting the result variable gives the desired output.

For example

doc2

Complexity Analysis :

                   Time Complexity : O(n)

                   Space Complexity:  O(1)

{tab title="C++" class="green"}


//A C++ program to find odd Occurrence of element in an given array using XOR method
//XOR METHOD
/* The code is contributed by Tangudu Sai Kiran. */
//A C++ program to find the odd times occurring element from a given input array using Hashing
#include <bits/stdc++.h>
using namespace std;

//Function to find element which occurred odd number of times
void findOccurance(int n, int arr[])
{
    //Defining a HashMap
    unordered_map<int, int> elements;

    //Inserting elements into the Hashmap
    for(int i = 0; i < n; i++)
        elements[arr[i]]++;

    //Iterate through the hashmap to find odd occurring element if exists
    for(auto it : elements)
    {
        //checking for majority condition
        if(it.second % 2 != 0)
        {
            cout<<"ODD OCCURRING ELEMENT: "<< it.first<< endl;
            return;
        }
    }
    cout<<"THERE IS NO ODD OCCURRING ELEMENT"<<endl;
    return;
}
int main()
{
    int arr[] = {6, 5, 2, 5, 4, 2, 6};
    int n = sizeof(arr) / sizeof(arr[0]);
    //Function call
    findOccurance(n, arr);
    return 0;
}

{tab title="Java" class="orange"}


//A JAVA program to find odd Occurrence of element in an given array using XOR method
//XOR METHOD

public class findOccurrenceNumber
{
	
	static void findOccurrence(int n, int arr[])
	{
		int result = 0;
		for (int i = 0; i < n; i++)
			result = result ^ arr[i];
		if(result == 0)
		    System.out.println("No odd times occurring element");
		else
    		System.out.print("Odd times occurring element:"+result);
	}
	
	public static void main(String[] args) 
	{
		int arr[] = {6, 5, 2, 5, 4, 2, 6};
		int n = arr.length;
		findOccurrence(n, arr);//Function call
	}

}

{tab title="Python" class="red"}


//XOR method to find odd Occurrence of element in array
def findOddOccurence(array):
    r=0
    for i in array:
        r=r^i
    print(r)
if __name__=="__main__":
    array=[6, 5, 2, 5, 4, 2, 6]
    findOddOccurence(array)

{/tabs}

6MBMemory Usage170msRequest Duration
Joomla! Version4.2.5
PHP Version7.4.33
Identityguest
Response200
Templateg5_helium
Database
Server
mysql
Version
5.7.23-23
Collation
utf8_unicode_ci
Conn Collation
utf8mb4_general_ci
$_GET
[]
$_POST
[]
$_SESSION
[]
$_COOKIE
[]
$_SERVER
array:87 [ "LSPHP_ENABLE_USER_INI" => "on" "PATH" => "/usr/local/bin:/usr/bin:/bin" "TEMP" => ...
session
array:3 [ "counter" => 1 "timer" => array:3 [ "start" => 1748152115 "last" => 1748152115...
registry
array:3 [ "data" => [] "initialized" => false "separator" => "." ]
user
array:18 [ "id" => 0 "name" => null "username" => null "email" => null "password" => "***r...
PHPDEBUGBAR_STACK_DATA
[]
  • afterLoad (552.78KB) (7.16ms)
  • afterInitialise (1.5MB) (30.51ms)
  • afterRoute (825.97KB) (23.33ms)
  • beforeRenderComponent com_content (139.59KB) (2.45ms)
  • Before Access::preloadComponents (all components) (55.55KB) (1.88ms)
  • After Access::preloadComponents (all components) (121KB) (1.4ms)
  • Before Access::preloadPermissions (com_content) (3.88KB) (32μs)
  • After Access::preloadPermissions (com_content) (256.8KB) (1.82ms)
  • Before Access::getAssetRules (id:1242 name:com_content.article.427) (18.8KB) (51μs)
  • After Access::getAssetRules (id:1242 name:com_content.article.427) (8.66KB) (343μs)
  • afterRenderComponent com_content (549.03KB) (21.76ms)
  • afterDispatch (2.25KB) (218μs)
  • beforeRenderRawModule mod_search (Search) (1.14MB) (23.27ms)
  • afterRenderRawModule mod_search (Search) (281.53KB) (5.62ms)
  • beforeRenderModule mod_search (Search) (704B) (15μs)
  • afterRenderModule mod_search (Search) (3.43KB) (298μs)
  • beforeRenderRawModule mod_articles_latest (Competitive Programming) (47.63KB) (2.38ms)
  • Before Access::getAssetRules (id:8 name:com_content) (119.03KB) (1.74ms)
  • After Access::getAssetRules (id:8 name:com_content) (1.59KB) (23μs)
  • afterRenderRawModule mod_articles_latest (Competitive Programming) (34.64KB) (4.62ms)
  • beforeRenderModule mod_articles_latest (Competitive Programming) (344B) (14μs)
  • afterRenderModule mod_articles_latest (Competitive Programming) (5.95KB) (256μs)
  • beforeRenderRawModule mod_jbounce (JBounce) (2.63KB) (76μs)
  • afterRenderRawModule mod_jbounce (JBounce) (2.5KB) (153μs)
  • beforeRenderModule mod_jbounce (JBounce) (720B) (6μs)
  • afterRenderModule mod_jbounce (JBounce) (1.28KB) (186μs)
  • afterRender (298.18KB) (26.44ms)
  • 1 x afterInitialise (1.5MB) (17.96%)
    30.51ms
    1 x afterRender (298.18KB) (15.57%)
    26.44ms
    1 x afterRoute (825.97KB) (13.73%)
    23.33ms
    1 x beforeRenderRawModule mod_search (Search) (1.14MB) (13.7%)
    23.27ms
    1 x afterRenderComponent com_content (549.03KB) (12.81%)
    21.76ms
    1 x afterLoad (552.78KB) (4.21%)
    7.16ms
    1 x afterRenderRawModule mod_search (Search) (281.53KB) (3.31%)
    5.62ms
    1 x afterRenderRawModule mod_articles_latest (Competitive Programming) (34.64KB) (2.72%)
    4.62ms
    1 x beforeRenderComponent com_content (139.59KB) (1.44%)
    2.45ms
    1 x beforeRenderRawModule mod_articles_latest (Competitive Programming) (47.63KB) (1.4%)
    2.38ms
    1 x Before Access::preloadComponents (all components) (55.55KB) (1.1%)
    1.88ms
    1 x After Access::preloadPermissions (com_content) (256.8KB) (1.07%)
    1.82ms
    1 x Before Access::getAssetRules (id:8 name:com_content) (119.03KB) (1.03%)
    1.74ms
    1 x After Access::preloadComponents (all components) (121KB) (0.82%)
    1.40ms
    1 x After Access::getAssetRules (id:1242 name:com_content.article.427) (8.66KB) (0.2%)
    343μs
    1 x afterRenderModule mod_search (Search) (3.43KB) (0.18%)
    298μs
    1 x afterRenderModule mod_articles_latest (Competitive Programming) (5.95KB) (0.15%)
    256μs
    1 x afterDispatch (2.25KB) (0.13%)
    218μs
    1 x afterRenderModule mod_jbounce (JBounce) (1.28KB) (0.11%)
    186μs
    1 x afterRenderRawModule mod_jbounce (JBounce) (2.5KB) (0.09%)
    153μs
    1 x beforeRenderRawModule mod_jbounce (JBounce) (2.63KB) (0.04%)
    76μs
    1 x Before Access::getAssetRules (id:1242 name:com_content.article.427) (18.8KB) (0.03%)
    51μs
    1 x Before Access::preloadPermissions (com_content) (3.88KB) (0.02%)
    32μs
    1 x After Access::getAssetRules (id:8 name:com_content) (1.59KB) (0.01%)
    23μs
    1 x beforeRenderModule mod_search (Search) (704B) (0.01%)
    15μs
    1 x beforeRenderModule mod_articles_latest (Competitive Programming) (344B) (0.01%)
    14μs
    1 x beforeRenderModule mod_jbounce (JBounce) (720B) (0%)
    6μs
34 statements were executed, 5 of which were duplicates, 29 unique15.8ms385.26KB
  • SELECT @@SESSION.sql_mode;131μs1.59KB/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:293Copy
  • SELECT `data` FROM `joom_session` WHERE `session_id` = ?217μs1.61KBParams/libraries/vendor/joomla/session/src/Handler/DatabaseHandler.php:261Copy
  • SELECT `session_id` FROM `joom_session` WHERE `session_id` = :session_id LIMIT 1126μs1.61KBParams/libraries/src/Session/MetadataManager.php:187Copy
  • INSERT INTO `joom_session` (`session_id`,`guest`,`time`,`userid`,`username`,`client_id`) VALUES (:session_id, :guest, :time, :user_id, :username, :client_id)230μs944BParams/libraries/src/Session/MetadataManager.php:260Copy
  • SELECT `extension_id` AS `id`,`element` AS `option`,`params`,`enabled` FROM `joom_extensions` WHERE `type` = 'component' AND `state` = 0 AND `enabled` = 1382μs4.73KB/libraries/src/Component/ComponentHelper.php:393Copy
  • SELECT `id`,`rules` FROM `joom_viewlevels`126μs1.06KB/libraries/src/Access/Access.php:955Copy
  • SELECT `b`.`id` FROM `joom_usergroups` AS `a` LEFT JOIN `joom_usergroups` AS `b` ON `b`.`lft` <= `a`.`lft` AND `b`.`rgt` >= `a`.`rgt` WHERE `a`.`id` = :guest211μs1.67KBParams/libraries/src/Access/Access.php:868Copy
  • SELECT `folder` AS `type`,`element` AS `name`,`params` AS `params`,`extension_id` AS `id` FROM `joom_extensions` WHERE `enabled` = 1 AND `type` = 'plugin' AND `state` IN (0,1) AND `access` IN (:preparedArray1,:preparedArray2) ORDER BY `ordering`684μs11.8KBParams/libraries/src/Plugin/PluginHelper.php:283Copy
  • SELECT `m`.`id`,`m`.`menutype`,`m`.`title`,`m`.`alias`,`m`.`note`,`m`.`link`,`m`.`type`,`m`.`level`,`m`.`language`,`m`.`browserNav`,`m`.`access`,`m`.`params`,`m`.`home`,`m`.`img`,`m`.`template_style_id`,`m`.`component_id`,`m`.`parent_id`,`m`.`path` AS `route`,`e`.`element` AS `component` FROM `joom_menu` AS `m` LEFT JOIN `joom_extensions` AS `e` ON `m`.`component_id` = `e`.`extension_id` WHERE ( (`m`.`published` = 1 AND `m`.`parent_id` > 0 AND `m`.`client_id` = 0) AND (`m`.`publish_up` IS NULL OR `m`.`publish_up` <= :currentDate1)) AND (`m`.`publish_down` IS NULL OR `m`.`publish_down` >= :currentDate2) ORDER BY `m`.`lft`662μs46.23KBParams/libraries/src/Menu/SiteMenu.php:166Copy
  • SELECT `c`.`id`,`c`.`asset_id`,`c`.`access`,`c`.`alias`,`c`.`checked_out`,`c`.`checked_out_time`,`c`.`created_time`,`c`.`created_user_id`,`c`.`description`,`c`.`extension`,`c`.`hits`,`c`.`language`,`c`.`level`,`c`.`lft`,`c`.`metadata`,`c`.`metadesc`,`c`.`metakey`,`c`.`modified_time`,`c`.`note`,`c`.`params`,`c`.`parent_id`,`c`.`path`,`c`.`published`,`c`.`rgt`,`c`.`title`,`c`.`modified_user_id`,`c`.`version`, CASE WHEN CHAR_LENGTH(`c`.`alias`) != 0 THEN CONCAT_WS(':', `c`.`id`, `c`.`alias`) ELSE `c`.`id` END as `slug` FROM `joom_categories` AS `s` INNER JOIN `joom_categories` AS `c` ON (`s`.`lft` <= `c`.`lft` AND `c`.`lft` < `s`.`rgt`) OR (`c`.`lft` < `s`.`lft` AND `s`.`rgt` < `c`.`rgt`) WHERE (`c`.`extension` = :extension OR `c`.`extension` = 'system') AND `c`.`published` = 1 AND `s`.`id` = :id ORDER BY `c`.`lft`525μs6.62KBParams/libraries/src/Categories/Categories.php:360Copy
  • SELECT `id`,`home`,`template`,`s`.`params`,`inheritable`,`parent` FROM `joom_template_styles` AS `s` LEFT JOIN `joom_extensions` AS `e` ON `e`.`element` = `s`.`template` AND `e`.`type` = 'template' AND `e`.`client_id` = `s`.`client_id` WHERE `s`.`client_id` = 0 AND `e`.`enabled` = 1331μs1.47KB/administrator/components/com_templates/src/Model/StyleModel.php:771Copy
  • SELECT s.id, s.template, s.home, s.title AS long_title, s.params FROM joom_template_styles AS s WHERE s.client_id = 0 AND s.template = 'g5_helium' ORDER BY s.id257μs1.23KB/libraries/gantry5/src/classes/Gantry/Joomla/StyleHelper.php:69Copy
  • SELECT * FROM `joom_languages` WHERE `published` = 1 ORDER BY `ordering` ASC269μs2.44KB/libraries/src/Language/LanguageHelper.php:142Copy
  • SELECT `id`,`name`,`rules`,`parent_id` FROM `joom_assets` WHERE `name` IN (:preparedArray1,:preparedArray2,:preparedArray3,:preparedArray4,:preparedArray5,:preparedArray6,:preparedArray7,:preparedArray8,:preparedArray9,:preparedArray10,:preparedArray11,:preparedArray12,:preparedArray13,:preparedArray14,:preparedArray15,:preparedArray16,:preparedArray17,:preparedArray18,:preparedArray19,:preparedArray20,:preparedArray21,:preparedArray22,:preparedArray23,:preparedArray24,:preparedArray25,:preparedArray26,:preparedArray27,:preparedArray28,:preparedArray29,:preparedArray30,:preparedArray31,:preparedArray32,:preparedArray33,:preparedArray34,:preparedArray35,:preparedArray36,:preparedArray37,:preparedArray38,:preparedArray39,:preparedArray40,:preparedArray41)687μs10.25KBParams/libraries/src/Access/Access.php:357Copy
  • SELECT `id`,`name`,`rules`,`parent_id` FROM `joom_assets` WHERE `name` LIKE :asset OR `name` = :extension OR `parent_id` = 0749μs69.8KBParams/libraries/src/Access/Access.php:301Copy
  • SHOW FULL COLUMNS FROM `joom_content`587μs10.39KB/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:584Copy
  • UPDATE joom_content SET `hits` = (`hits` + 1) WHERE `id` = '427'276μs2.55KB/libraries/src/Table/Table.php:1319Copy
  • SELECT `a`.`id`,`a`.`asset_id`,`a`.`title`,`a`.`alias`,`a`.`introtext`,`a`.`fulltext`,`a`.`state`,`a`.`catid`,`a`.`created`,`a`.`created_by`,`a`.`created_by_alias`,`a`.`modified`,`a`.`modified_by`,`a`.`checked_out`,`a`.`checked_out_time`,`a`.`publish_up`,`a`.`publish_down`,`a`.`images`,`a`.`urls`,`a`.`attribs`,`a`.`version`,`a`.`ordering`,`a`.`metakey`,`a`.`metadesc`,`a`.`access`,`a`.`hits`,`a`.`metadata`,`a`.`featured`,`a`.`language`,`fp`.`featured_up`,`fp`.`featured_down`,`c`.`title` AS `category_title`,`c`.`alias` AS `category_alias`,`c`.`access` AS `category_access`,`c`.`language` AS `category_language`,`fp`.`ordering`,`u`.`name` AS `author`,`parent`.`title` AS `parent_title`,`parent`.`id` AS `parent_id`,`parent`.`path` AS `parent_route`,`parent`.`alias` AS `parent_alias`,`parent`.`language` AS `parent_language`,ROUND(`v`.`rating_sum` / `v`.`rating_count`, 1) AS `rating`,`v`.`rating_count` AS `rating_count` FROM `joom_content` AS `a` INNER JOIN `joom_categories` AS `c` ON `c`.`id` = `a`.`catid` LEFT JOIN `joom_content_frontpage` AS `fp` ON `fp`.`content_id` = `a`.`id` LEFT JOIN `joom_users` AS `u` ON `u`.`id` = `a`.`created_by` LEFT JOIN `joom_categories` AS `parent` ON `parent`.`id` = `c`.`parent_id` LEFT JOIN `joom_content_rating` AS `v` ON `a`.`id` = `v`.`content_id` WHERE ( (`a`.`id` = :pk AND `c`.`published` > 0) AND (`a`.`publish_up` IS NULL OR `a`.`publish_up` <= :publishUp)) AND (`a`.`publish_down` IS NULL OR `a`.`publish_down` >= :publishDown) AND `a`.`state` IN (:preparedArray1,:preparedArray2)626μs25.38KBParams/components/com_content/src/Model/ArticleModel.php:215Copy
  • SELECT `c`.`id`,`c`.`asset_id`,`c`.`access`,`c`.`alias`,`c`.`checked_out`,`c`.`checked_out_time`,`c`.`created_time`,`c`.`created_user_id`,`c`.`description`,`c`.`extension`,`c`.`hits`,`c`.`language`,`c`.`level`,`c`.`lft`,`c`.`metadata`,`c`.`metadesc`,`c`.`metakey`,`c`.`modified_time`,`c`.`note`,`c`.`params`,`c`.`parent_id`,`c`.`path`,`c`.`published`,`c`.`rgt`,`c`.`title`,`c`.`modified_user_id`,`c`.`version`, CASE WHEN CHAR_LENGTH(`c`.`alias`) != 0 THEN CONCAT_WS(':', `c`.`id`, `c`.`alias`) ELSE `c`.`id` END as `slug` FROM `joom_categories` AS `s` INNER JOIN `joom_categories` AS `c` ON (`s`.`lft` <= `c`.`lft` AND `c`.`lft` < `s`.`rgt`) OR (`c`.`lft` < `s`.`lft` AND `s`.`rgt` < `c`.`rgt`) WHERE (`c`.`extension` = :extension OR `c`.`extension` = 'system') AND `c`.`access` IN (:preparedArray1,:preparedArray2) AND `c`.`published` = 1 AND `s`.`id` = :id ORDER BY `c`.`lft`483μs6.67KBParams/libraries/src/Categories/Categories.php:360Copy
  • SELECT `m`.`tag_id`,`t`.* FROM `joom_contentitem_tag_map` AS `m` INNER JOIN `joom_tags` AS `t` ON `m`.`tag_id` = `t`.`id` WHERE `m`.`type_alias` = :contentType AND `m`.`content_item_id` = :id AND `t`.`published` = 1 AND `t`.`access` IN (:preparedArray1,:preparedArray2)519μs6.25KBParams/libraries/src/Helper/TagsHelper.php:364Copy
  • SELECT `c`.`id`,`c`.`asset_id`,`c`.`access`,`c`.`alias`,`c`.`checked_out`,`c`.`checked_out_time`,`c`.`created_time`,`c`.`created_user_id`,`c`.`description`,`c`.`extension`,`c`.`hits`,`c`.`language`,`c`.`level`,`c`.`lft`,`c`.`metadata`,`c`.`metadesc`,`c`.`metakey`,`c`.`modified_time`,`c`.`note`,`c`.`params`,`c`.`parent_id`,`c`.`path`,`c`.`published`,`c`.`rgt`,`c`.`title`,`c`.`modified_user_id`,`c`.`version`, CASE WHEN CHAR_LENGTH(`c`.`alias`) != 0 THEN CONCAT_WS(':', `c`.`id`, `c`.`alias`) ELSE `c`.`id` END as `slug` FROM `joom_categories` AS `s` INNER JOIN `joom_categories` AS `c` ON (`s`.`lft` <= `c`.`lft` AND `c`.`lft` < `s`.`rgt`) OR (`c`.`lft` < `s`.`lft` AND `s`.`rgt` < `c`.`rgt`) WHERE (`c`.`extension` = :extension OR `c`.`extension` = 'system') AND `c`.`access` IN (:preparedArray1,:preparedArray2) AND `c`.`published` = 1 AND `s`.`id` = :id ORDER BY `c`.`lft`464μs6.67KBParams/libraries/src/Categories/Categories.php:360Copy
  • SELECT DISTINCT a.id, a.title, a.name, a.checked_out, a.checked_out_time, a.note, a.state, a.access, a.created_time, a.created_user_id, a.ordering, a.language, a.fieldparams, a.params, a.type, a.default_value, a.context, a.group_id, a.label, a.description, a.required, a.only_use_in_subform,l.title AS language_title, l.image AS language_image,uc.name AS editor,ag.title AS access_level,ua.name AS author_name,g.title AS group_title, g.access as group_access, g.state AS group_state, g.note as group_note FROM joom_fields AS a LEFT JOIN `joom_languages` AS l ON l.lang_code = a.language LEFT JOIN joom_users AS uc ON uc.id=a.checked_out LEFT JOIN joom_viewlevels AS ag ON ag.id = a.access LEFT JOIN joom_users AS ua ON ua.id = a.created_user_id LEFT JOIN joom_fields_groups AS g ON g.id = a.group_id LEFT JOIN `joom_fields_categories` AS fc ON fc.field_id = a.id WHERE ( (`a`.`context` = :context AND (`fc`.`category_id` IS NULL OR `fc`.`category_id` IN (:preparedArray1,:preparedArray2,:preparedArray3)) AND `a`.`access` IN (:preparedArray4,:preparedArray5)) AND (`a`.`group_id` = 0 OR `g`.`access` IN (:preparedArray6,:preparedArray7)) AND `a`.`state` = :state) AND (`a`.`group_id` = 0 OR `g`.`state` = :gstate) AND `a`.`only_use_in_subform` = :only_use_in_subform ORDER BY a.ordering ASC722μs6.06KBParams/libraries/src/MVC/Model/BaseDatabaseModel.php:165Copy
  • SELECT `contact`.`id` AS `contactid`,`contact`.`alias`,`contact`.`catid`,`contact`.`webpage`,`contact`.`email_to` FROM `joom_contact_details` AS `contact` WHERE `contact`.`published` = 1 AND `contact`.`user_id` = :createdby ORDER BY `contact`.`id` DESC LIMIT 1463μs1.84KBParams/plugins/content/contact/contact.php:147Copy
  • SELECT `a`.`id`,`a`.`title`,`a`.`catid`,`a`.`language`, CASE WHEN CHAR_LENGTH(`a`.`alias`) != 0 THEN CONCAT_WS(':', `a`.`id`, `a`.`alias`) ELSE a.id END AS `slug`, CASE WHEN CHAR_LENGTH(`cc`.`alias`) != 0 THEN CONCAT_WS(':', `cc`.`id`, `cc`.`alias`) ELSE cc.id END AS `catslug` FROM `joom_content` AS `a` LEFT JOIN `joom_categories` AS `cc` ON `cc`.`id` = `a`.`catid` WHERE `a`.`catid` = :catid AND `a`.`state` = :state AND `a`.`access` IN (:preparedArray1,:preparedArray2) AND (`publish_up` IS NULL OR `publish_up` <= :nowDate1) AND (`publish_down` IS NULL OR `publish_down` >= :nowDate2) ORDER BY CASE WHEN `a`.`publish_up` IS NULL THEN `a`.`created` ELSE `a`.`publish_up` END DESC642μs4.41KBParams/plugins/content/pagenavigation/pagenavigation.php:186Copy
  • SELECT `c`.`id`,`c`.`asset_id`,`c`.`access`,`c`.`alias`,`c`.`checked_out`,`c`.`checked_out_time`,`c`.`created_time`,`c`.`created_user_id`,`c`.`description`,`c`.`extension`,`c`.`hits`,`c`.`language`,`c`.`level`,`c`.`lft`,`c`.`metadata`,`c`.`metadesc`,`c`.`metakey`,`c`.`modified_time`,`c`.`note`,`c`.`params`,`c`.`parent_id`,`c`.`path`,`c`.`published`,`c`.`rgt`,`c`.`title`,`c`.`modified_user_id`,`c`.`version`, CASE WHEN CHAR_LENGTH(`c`.`alias`) != 0 THEN CONCAT_WS(':', `c`.`id`, `c`.`alias`) ELSE `c`.`id` END as `slug` FROM `joom_categories` AS `s` INNER JOIN `joom_categories` AS `c` ON (`s`.`lft` <= `c`.`lft` AND `c`.`lft` < `s`.`rgt`) OR (`c`.`lft` < `s`.`lft` AND `s`.`rgt` < `c`.`rgt`) WHERE (`c`.`extension` = :extension OR `c`.`extension` = 'system') AND `c`.`access` IN (:preparedArray1,:preparedArray2) AND `c`.`published` = 1 AND `s`.`id` = :id ORDER BY `c`.`lft`475μs6.67KBParams/libraries/src/Categories/Categories.php:360Copy
  • SELECT `a`.`menutype`,`a`.`title` FROM `joom_menu_types` AS `a` WHERE `a`.`client_id` = 0197μs1.06KB/libraries/gantry5/src/classes/Gantry/Framework/Menu.php:138Copy
  • SELECT m.id, m.alias, m.path AS route, m.level, m.parent_id FROM joom_menu AS m WHERE m.menutype = 'main-menu' AND m.parent_id > 0 AND m.client_id = 0 AND m.published >= 0 ORDER BY m.lft402μs3.17KB/libraries/gantry5/src/classes/Gantry/Framework/Menu.php:791Copy
  • SELECT `m`.`id`,`m`.`title`,`m`.`module`,`m`.`position`,`m`.`content`,`m`.`showtitle`,`m`.`params`,`mm`.`menuid` FROM `joom_modules` AS `m` LEFT JOIN `joom_modules_menu` AS `mm` ON `mm`.`moduleid` = `m`.`id` LEFT JOIN `joom_extensions` AS `e` ON `e`.`element` = `m`.`module` AND `e`.`client_id` = `m`.`client_id` WHERE ( ( (`m`.`published` = 1 AND `e`.`enabled` = 1 AND `m`.`client_id` = :clientId AND `m`.`access` IN (:preparedArray1,:preparedArray2)) AND (`m`.`publish_up` IS NULL OR `m`.`publish_up` <= :publishUp)) AND (`m`.`publish_down` IS NULL OR `m`.`publish_down` >= :publishDown)) AND (`mm`.`menuid` = :itemId OR `mm`.`menuid` <= 0) ORDER BY `m`.`position`,`m`.`ordering`710μs3.53KBParams/libraries/src/Cache/Controller/CallbackController.php:52Copy
  • SELECT `alias` FROM `joom_content` WHERE `id` = :id184μs1.64KBParams/components/com_content/src/Service/Router.php:168Copy
  • SELECT `alias` FROM `joom_content` WHERE `id` = :id130μs1.64KBParams/components/com_content/src/Service/Router.php:168Copy
  • SELECT m.id, m.alias, m.path AS route, m.level, m.parent_id FROM joom_menu AS m WHERE m.menutype = 'my-menu' AND m.parent_id > 0 AND m.client_id = 0 AND m.published >= 0 ORDER BY m.lft301μs1.56KB/libraries/gantry5/src/classes/Gantry/Framework/Menu.php:791Copy
  • SELECT `a`.`id`,`a`.`title`,`a`.`alias`,`a`.`introtext`,`a`.`fulltext`,`a`.`checked_out`,`a`.`checked_out_time`,`a`.`catid`,`a`.`created`,`a`.`created_by`,`a`.`created_by_alias`,`a`.`modified`,`a`.`modified_by`,CASE WHEN `a`.`publish_up` IS NULL THEN `a`.`created` ELSE `a`.`publish_up` END AS `publish_up`,`a`.`publish_down`,`a`.`images`,`a`.`urls`,`a`.`attribs`,`a`.`metadata`,`a`.`metakey`,`a`.`metadesc`,`a`.`access`,`a`.`hits`,`a`.`featured`,`a`.`language`,LENGTH(`a`.`fulltext`) AS `readmore`,`a`.`ordering`,`fp`.`featured_up`,`fp`.`featured_down`,CASE WHEN `c`.`published` = 2 AND `a`.`state` > 0 THEN 2 WHEN `c`.`published` != 1 THEN 0 ELSE `a`.`state` END AS `state`,`c`.`title` AS `category_title`,`c`.`path` AS `category_route`,`c`.`access` AS `category_access`,`c`.`alias` AS `category_alias`,`c`.`language` AS `category_language`,`c`.`published`,`c`.`published` AS `parents_published`,`c`.`lft`,CASE WHEN `a`.`created_by_alias` > ' ' THEN `a`.`created_by_alias` ELSE `ua`.`name` END AS `author`,`ua`.`email` AS `author_email`,`uam`.`name` AS `modified_by_name`,`parent`.`title` AS `parent_title`,`parent`.`id` AS `parent_id`,`parent`.`path` AS `parent_route`,`parent`.`alias` AS `parent_alias`,`parent`.`language` AS `parent_language` FROM `joom_content` AS `a` LEFT JOIN `joom_categories` AS `c` ON `c`.`id` = `a`.`catid` LEFT JOIN `joom_users` AS `ua` ON `ua`.`id` = `a`.`created_by` LEFT JOIN `joom_users` AS `uam` ON `uam`.`id` = `a`.`modified_by` LEFT JOIN `joom_categories` AS `parent` ON `parent`.`id` = `c`.`parent_id` LEFT JOIN `joom_content_frontpage` AS `fp` ON `fp`.`content_id` = `a`.`id` WHERE `c`.`published` = 1 AND `a`.`state` = :condition AND `a`.`catid` IN (:preparedArray1) AND (`a`.`publish_up` IS NULL OR `a`.`publish_up` <= :publishUp) AND (`a`.`publish_down` IS NULL OR `a`.`publish_down` >= :publishDown) ORDER BY RAND() DESC LIMIT 102.01ms112.84KBParams/libraries/src/MVC/Model/BaseDatabaseModel.php:165Copy
  • SELECT `a`.`id`,`a`.`asset_id`,`a`.`title`,`a`.`type`,`a`.`execution_rules`,`a`.`state`,`a`.`last_exit_code`,`a`.`locked`,`a`.`last_execution`,`a`.`next_execution`,`a`.`times_executed`,`a`.`times_failed`,`a`.`priority`,`a`.`ordering`,`a`.`note`,`a`.`checked_out`,`a`.`checked_out_time`,`uc`.`name` AS `editor` FROM `joom_scheduler_tasks` AS `a` LEFT JOIN `joom_users` AS `uc` ON `uc`.`id` = `a`.`checked_out` WHERE `a`.`state` = :state AND `a`.`next_execution` <= :now ORDER BY `a`.`title` asc549μs15.45KBParams/administrator/components/com_scheduler/src/Model/TasksModel.php:391Copy
  • SELECT `a`.`id`,`a`.`asset_id`,`a`.`title`,`a`.`type`,`a`.`execution_rules`,`a`.`state`,`a`.`last_exit_code`,`a`.`locked`,`a`.`last_execution`,`a`.`next_execution`,`a`.`times_executed`,`a`.`times_failed`,`a`.`priority`,`a`.`ordering`,`a`.`note`,`a`.`checked_out`,`a`.`checked_out_time`,`uc`.`name` AS `editor` FROM `joom_scheduler_tasks` AS `a` LEFT JOIN `joom_users` AS `uc` ON `uc`.`id` = `a`.`checked_out` WHERE `a`.`state` = :state AND `a`.`locked` IS NOT NULL ORDER BY `a`.`title` asc469μs4.43KBParams/administrator/components/com_scheduler/src/Model/TasksModel.php:391Copy