Category: SQL

0

Username Availability Check

This will be a walk-through on how to create a submit form that checks the database to make sure the username is not taken.  If it is taken it will not allow the submit...

0

MySQL – find in set vs in

These are two different commands with different outputs when added to a SQL query. MySQL “in” command for example: select * from assets a left outer join assetInterests ai on a.id = ai.assetID where...

0

Simple Twitter Auto Poster

This is the first in what will end up being a several part tutorial on creating a Twitter posting program.  These tutorials will show how to create the bot using the PHP library that...

0

WordPress SQL Syntax Example

I have a couple of tables I’m joining and only want to return users that a field missing in the joined table. Users id fname lname userMeta id metaKey metaValue I’m trying to find...

0

SQL Case Statement Example

Basic syntax for using case when statements in SQL. For this example we want the following: If Field1 = 2 and Field2 = 2 then use the date in Field3 else use ‘1/1/3000’. Here...

0

SQL Syntax for Summing an Alias and Grouping by ID

Simple SQL query to sum an alias column and group by ID. Initial query user needed help with: select dt.member_id, dt.NumberOfMonthsBetween FROM ( select member_id, DATEDIFF(month,date_credentialed,renewal_date) as NumberOfMonthsBetween from member_credential ) dt where dt.NumberOfMonthsBetween...