I finally got the solution. Below SQL Query gets the list of all categories with it’s ID from WordPress table –
SELECT wp_term_taxonomy.term_id, wp_terms.name FROM wp_term_relationships
LEFT JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id)
LEFT JOIN wp_terms ON (wp_terms.term_id = wp_term_taxonomy.term_taxonomy_id)
WHERE wp_term_taxonomy.taxonomy = 'category'
GROUP BY wp_term_taxonomy.term_id
order by wp_terms.name
Hope this could help others.
Related Posts:
- How Do I Merge Categories With phpMyAdmin
- Accessing WordPress MySQL Database via Data Connection in Visual Studio 2010 using C#
- How Do I Delete WordPress Posts Older Than 400 Days, From A WordPress Category
- How To Find Out WordPress Category Table in MYSQL?
- How to convert regular categories to custom taxonomy?
- How to create 450 categories in wp
- Custom Query to search through categories
- Deleting All tags except categories Wp database
- how to remove category from database
- Disallow categories from this MySQL query
- Change the category of all posts in it
- How to run select query of post with category and tags for API?
- How to get related tags based on a category?
- SQL to migrate post types to taxonomy
- Drop posts from categories in MySql
- WordPress Post # of # filtered by category slug
- Can Categories be used to hack a Multisite-like setup w/ a single MySql db?
- Wacky taxonomy in wordpress
- Array: What is this value based on?
- Deleting a category from WordPress admin does it remove it completely from the database?
- How to store category and tags separatly on wordpress?
- WordPress: Using the category slug get the category ID using mysql query
- How to add categories using mysql
- Create categories manually in database
- How do I merge WooCommerce categories with the same name?
- Search Replace Database ONLY for posts of certain category?
- Bulk Change WordPress category Slug
- how to get postmeta info based on multiple categories?
- Backend – Categories and Menus conflicts
- finding out the top 5 source ( source is a custom taxonomy ), in a given category
- add an image field to wordpress category
- How to make that all posts with a category belong also to another
- Fetch all categories from database
- select posts from sql except posts from specific category
- I would like to feature a tip on the homepage
- Show Secondary Sidebar on Category pages (archive)
- How can I filter posts by tag on the fly
- Redirect depending on category chosen
- How could I write a get_categories_by_year() function?
- How to add icon over specific thumb
- Can I prioritize post categories for choice for breadcrumb trail?
- url for posts for a date within a category
- Rebuilding a Site: How to Show Several Category Posts in Woo Framework Theme?
- Get categories of queried posts
- add_settings_field (exclude categories->reading) wp_category_checklist
- Retrieve post tags from from main wp_query
- Post Loop Category first show parent then child
- Listing Post Categories on Home Page
- Displaying another main nav menu for specific category
- Exclude categories from list (wp_list_categories)
- Query from multiple category (and)
- Get posts in a subcategory of a chosen parent
- Get categories related to particular category
- select a single val though a table in wordpress
- How can I only display links from a child category
- Can’t iterate through 2 levels of categories
- Wp Dropdown Category Not Show Current As Title
- Limit Loop to One Category
- How to display posts from specific category using get_option function?
- How to load several hierarchical categories from functions.php
- Displaying a custom field in Category Archives
- Second ezSQL initialization for MSSQL
- wordpress taxonomy query posts
- Problem with Custom Post Type Categories
- Display post thumbnail for specific category outside the loop
- List post only under the category, exclude child category content
- Display Sub-categories or Child Pages of Parent Cat/Page?
- Assign a custom post to a custom taxonomy based on custom field value
- Fetch a single row from a custom table for to a given ID
- How to get category names in post_class?
- How can i show categories of custom post
- How to check if a categoryID exists in a theme options page
- Database create or redirect
- PHP dynamical conditional post display
- wp_dropdown_categories initial value
- How to display product categories and number of sales on WooCommerce
- Posts of specific category on page and excluded from index.htm
- Display one category and its suncategories
- output only if within a combination of two cats
- Add multiple orderby with pre get posts
- How to differentiate the homepage structure from the category page structure in WordPress template?
- Panoramica Theme Portfolio
- new WP_Query issues
- Multiple category columns and post counting list in wordpress Homepage
- Filter Category Loop Dynamically
- Advanced permalinks structure
- SQL query to get posts from multiple categories but not in a category
- Can each user have only access to a private area (his own categories and posts)?
- Setting selected term_id with wp_dropdown_categories?
- Filter categories/tags to display in multiple metaboxes for selection in back-end
- how can i hide category?
- Check is category parent with ids from the childs – get_term_children
- Pagination breaks on child-categories, works fine on parent-category
- Homepage custom recent news
- post_class remove tag- or category- from slug
- Assigning certain pages or posts to use the template of the parent page or category
- Showing posts from 2 categories only on category.php
- Is the part “category” fixed to an URL to an archive or post?
- Posts not listing out sub category in hierarchy
- creating categories programmatically