Instaling Navicat Premium1/15/2024 What Sets Redis Apart from Other Databases.Understanding Navicat Connection Profiles.Choosing Between Redis and a Traditional Relational Database.Measuring Query Execution Time in Relational Databases.Run the query and verify that all 22 rows list GENE HOPKINS as one of the film's actors: You'll see that the "WHERE film_list.actors LIKE '%GENE HOPKINS%'" line has been appended to the SELECT statement in the Query Editor. With our WHERE criteria set, click the Query Builder's OK button to close the dialog. Click the "" label to the right of the equals sign ("=") and enter "'%GENE HOPKINS%'" (without the double quotes) in the Edit tab: Next, we'll enter the actor that we're looking for. That opens a list of comparison operators to choose from. Click on the "" label to the left of the equals sign ("=") and select the film_list.actors item from the field list tab in the popup dialog (it's the last one): We can search the actors field using a Like expression. Let's proceed to fill out the expression from left to right, as we would in writing a query by hand. It's actually three different clickable regions: Clicking the "" label changes the text to the " = " expression. In the Query Builder, all labels within "" brackets are clickable and open a context-specific list and/or editor. INNER JOIN film_list ON film.film_id = film_list.FIDīeside the WHERE clause you'll see the label "". One way to further limit the number of rows returned would be to include only certain actors that we wanted information on.Īdd the following SQL to the Navicat Premium Query Editor and click the Query Builder button to display it in the Query Builder: For instance, taking our query from part 1 that produced a list of actors that appeared in movies released during a given year, it still returned almost one thousand rows. It's useful in reducing the number of rows returned by specifying the subset of records that we're interested in. The WHERE clause is the section of a SELECT query that filters the results based on a set of criteria. Please refer to the Generating Reports on MySQL Data tutorial for instructions on downloading and installing the Sakila database. It contains a number of tables themed around the film industry that cover everything from actors and film studios to video rental stores. About the Sakila Sample DatabaseĪs with parts 1 and 2, the queries that we'll be building here today will run against the Sakila sample database. Today's blog will provide an overview on adding WHERE criteria to a SELECT query using the Navicat Premium Query Builder. In Part 1, we used it to write a query to fetch a list of actors that appeared in movies released during a given year. Available in Non-Essentials editions of Navicat for MySQL, PostgreSQL, SQLite, MariaDB, and Navicat Premium, the Query Builder is a tool for creating and editing queries visually.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |