Showing entries 1 to 10 of 12
2 Older Entries »
Displaying posts with tag: SQL Developer (reset)
INSERT Using the WITH Clause in MySQL

As of MySQL v8, we have Common Table Expressions (CTEs) or the WITH clause available. I recently learned how to use the WITH clause in an INSERT statement, similar to INSERT with SELECT. Like always, I enjoy sharing what I learn so let’s all learn together…

The Newsletter for PHP and MySQL Developers

Receive a copy of my ebook, “10 MySQL Tips For Everyone”, absolutely free when you subscribe to the OpenLampTech newsletter.

For the sake of simplicity (and my sanity) I’m using this arbitrary sample data:

SELECT *
FROM auto_test;

We can use the WITH clause to generate a …

[Read more]
Filter Data in the MySQL WHERE Clause With Less Than and Greater Than Comparisons

While equality and inequality filter conditions are very common, many times you wish to filter the FROM clause table rows based on values that are less than or greater than another value. MySQL (and SQL in general) supports the less than (<) and greater than (>) operators. Continue reading and see examples of each…

The Newsletter for PHP and MySQL Developers

Receive a copy of my ebook, “10 MySQL Tips For Everyone”, absolutely free when you subscribe to the OpenLampTech newsletter.

Image by 준원 서 from  …

[Read more]
MySQL WHERE Clause Inequality Comparison Operators

Just as you want to filter the rows of data returned in a SELECT query with the equality comparison operator (=), you can also create a conditional filter to test if 2 values are not equal to one another. Learn more in the following article.

The Newsletter for PHP and MySQL Developers

Receive a copy of my ebook, “10 MySQL Tips For Everyone”, absolutely free when you subscribe to the OpenLampTech newsletter.

Image by Peggy und Marco Lachmann-Anke from  …

[Read more]
MySQL String Concatenation with CONCAT()

Joining individual pieces of text data into a singular string is nothing new in the programming world and all languages support some form of concatenation. In MySQL, you can use the CONCAT() function. Let’s see how…

Image by Alejandro González from Pixabay 

The Newsletter for PHP and MySQL Developers

Receive a copy of my ebook, “10 MySQL Tips For Everyone”, absolutely free when you subscribe to the …

[Read more]
MySQL Simple CASE Expression – with examples

Programming logic is foundational in any application or piece of software. Without it, software wouldn’t really do much of anything. Everything happens off of choice. In the end, some truthy or falsy value is what makes stuff work. For IF/THEN/ELSE logic in standard SQL, there is the CASE expression. There are 2 variations of the CASE Expression: Simple and Searched. In this post, I cover the Simple MySQL CASE expression with example queries…

Image by Nika Akin from …

[Read more]
MySQL Column Aliases using the AS keyword

Be it running reports or displaying data in some other visualization, SQL SELECT column expressions should be meaningful and understandable. To provide those valuable query results, SQL Developers, use a multitude of available functions, adjacent columns, or other means not readily apparent to end-users. All that being said, the column names often suffer the most as far as readability is concerned, taking on long function call names or other combined expressions. But, as luck would be on our side, there is an easy fix and that is aliasing columns using the AS keyword. Although AS is optional – in this particular context – I err on the side of readability and use it when aliasing SELECT column expressions.

Image by …

[Read more]
MySQL Count Weekday occurrences

Each SQL dialect is different in some way, shape, form, or fashion from the next flavor. Some dialects have this function, while others have that function. In this post, I cover porting over Oracle SQL to MySQL in order to count the number of occurrences of a specific weekday found in the current given month (at the time of writing) purely as a learning exercise focused on MySQL DATE functions and the WITH clause…

Image by tigerlily713 from Pixabay

[Read more]
MySQL’s AUTO_INCREMENT attribute

Most developers use some form of auto-incrementing integer counter for a given database table, ensuring uniqueness among the rows. Several of the popular SQL dialects implement this facility. For instance, MySQL’s AUTO_INCREMENT attribute is used to provide a unique identity for a table row. What exactly is the behavior of AUTO_INCREMENT? Can you explicitly use a value of your choosing for it if you need to? How does it count? Continue reading and know the answers to these questions and more…

Image by Gerd Altmann from …

[Read more]
Top n Window Function queries in MySQL

Top n Window Function queries over a specific subset of data are common in analysis and reporting requirements. Luckily, in MySQL, there are Window functions we can use for this type of query. To be quite honest, you don’t necessarily need Window Functions. You can retrieve those top 3 (or whatever) types of results with a regular SQL query. But, since we have those powerful Window Functions, why not use them? My thoughts exactly! Besides, no one wants a spaghetti code mess of SQL to try and understand. Not to mention, Window functions are often better optimized for querying larger data sets. Continue reading and see example queries for more understanding…

Image by …

[Read more]
3 MySQL Commands Developers should know.

If you are a developer working in a MySQL environment, this blog post is for you. I share 3 MySQL commands or statements that you should know. That is a bold statement, I know. Turns out, once you do know (of) these commands, you will use them all the time. They minimize guesswork which leads to better productivity in other facets of your programming and querying workflow. I use them myself almost daily and am sure you will too once you see how simple they are to use. So why should you know them? Continue reading and find out…

Photo by hannah joshua on Unsplash

OS, Software, and DB used:

  • OpenSuse Leap 15.1
[Read more]
Showing entries 1 to 10 of 12
2 Older Entries »