Drupal: Show SQL Query of the View

Working with Drupal views, is amazing isn’t it? Of course, if you have any experience with it. But in my future post, I will explain how to make a view and what is the usage of it in Drupal.

But in this post I am going to share a developer’s tip of the day.

How to preview SQL of the view?

Go to the /admin/structure/views/settings click the checkbox from Show the SQL query.

After you you checked the checkbox, SQL will be displayed in view edit page. In my case I am case I made a new view called “Articles” /admin/structure/views/view/articles

It’s quite useful most of the times, if you need to debug that how data is being fetched.

Author: Danyal
I'm working as programmer since 2002. Born, grew up, studied and worked in Pakistan now Im located in Denmark since 2006.