<< < 43 44 45 46 47 48 49 50 51 52 > >>   ∑:1233  Sort:Date

Using Group Functions in the ORDER BY Clause in MySQL
Can Group Functions Be Used in the ORDER BY Clause in MySQL? If the query output is aggregated as groups, you can sort the groups by using group functions in the ORDER BY clause. The following statement returns how many links were created in each year in each tag. The group output is sorted by the c...
2017-12-31, 1285🔥, 0💬

"CREATE TRIGGER" - Creating a DML Trigger in SQL Server
How To Create a DML Trigger using CREATE TRIGGER Statements in SQL Server? A DML trigger is a trigger declared to handle a DML event, which occurs when an INSERT, UPDATE or DELETE statement is executed. If you want to create a DML trigger, you should use the "CREATE TRIGGER" statement in the followi...
2016-10-25, 1285🔥, 0💬

Creating a New Database in MySQL
How To Create a New Database in MySQL? A database in a MySQL server is a logical container used to group tables and other data objects together as a unit. If you are the administrator of the server, you can create a new databases using the CREATE DATABASE statements with MySQL client interface progr...
2017-11-11, 1284🔥, 0💬

"DELETED" - Old Record of an DML Event Instance in SQL Server
How To Access the Deleted Record of an Event in SQL Server? When a DML event occurs, SQL Server will prepare a temporary table called "DELETED", which contains the old record of the affected row, which is: A copy of the deleted row for a DELETE statement. A copy of the row to be updated for an UPDAT...
2016-10-24, 1283🔥, 0💬

List All Tables with "mysql" Command in MySQL
How To Show All Tables with "mysql" in MySQL? If you want to see all the tables in a database, you run the non-SQL command "SHOW TABLES" at the "mysql" prompt. See the following tutorial exercise for example: &gt;cd \mysql\bin &gt;mysql -u root test Welcome to the MySQL monitor. Commands end...
2018-02-28, 1282🔥, 0💬

Running MySQL Server on a Specific Port in MySQL
How To Run MySQL Server on a Different Port in MySQL? By default, MySQL will listen at port number 3306 for any client connections. But you can change this by starting the server with "--port=portNumber" option. The tutorial exercise shows you how to start the server to listen to a different port nu...
2017-11-29, 1280🔥, 0💬

Getting a List of All Databases on the Server in SQL Server
How to get a list all databases on the SQL server in SQL Server? If you don't remember database names you have created, you can get a list of all databases on the server by query the "sys.databases" view as shown in this tutorial example: CREATE DATABASE FyiCenterData GO SELECT name, database_id, cr...
2016-11-24, 1280🔥, 0💬

Counting Groups Returned from GROUP BY in MySQL
How To Count Groups Returned with the GROUP BY Clause in MySQL? If you use the COUNT(*) function on groups returned with the GROUP BY clause, it will count the number of rows within each group, not the number of groups. If you want to count the number of groups, you can put the GROUP BY query into a...
2017-12-21, 1278🔥, 0💬

Security Principals Used in SQL Server 2005 in SQL Server
What Are Security Principals Used in SQL Server 2005 in SQL Server? SQL Server 2005 supports several basic security principals located at different levels: Windows-Level Principals: Windows Local Login and Windows Network Domain Login - Used to control accesses to SQL Server instances. SQL Server-Le...
2016-10-20, 1278🔥, 0💬

"DROP TABLE" - Deleting Existing Tables in SQL Server
How To Drop an Existing Table with "DROP TABLE" Statements in SQL Server? If you want to delete an existing table and its data rows, you can use the "DROP TABLE" statement as shown in the tutorial script below: SELECT * FROM tipBackup GO id subject description create_date 1 Learn SQL Visit dev.fyice...
2016-11-15, 1274🔥, 0💬

Entering Microseconds in SQL Statements in MySQL
How To Enter Microseconds in SQL Statements in MySQL? If you want to enter microseconds in a SQL statements, you can enter them right after the time string as a 6-digit number delimited with '.'. '0' will be padded to right if not enough digits. Here are some good examples: SELECT TIME('1997/01/31 0...
2017-12-26, 1272🔥, 0💬

PHP ODBC - Query Multiple Tables Jointly
PHP ODBC - How To Query Multiple Tables Jointly? If you want to query information stored in multiple tables, you can use the SELECT statement with a WHERE condition to make an inner join. Assuming that you have 3 tables in a forum system: "users" for user profile, "forums" for forums information, an...
2023-12-30, 1270🔥, 0💬

Inserting Rows with a SELECT Statement in MySQL
How To Insert Multiple Rows with a SELECT Statement in MySQL? If want to insert rows into a table based on data rows from other tables, you can use a sub-query inside the INSERT statement as shown in the following script example: &lt;?php include "mysql_connection.php"; $sql = "INSERT INTO fyi_l...
2017-09-20, 1267🔥, 0💬

"OPEN" - Executing the Query of a Cursor in SQL Server
How To Execute the Cursor Queries with "OPEN" Statements in SQL Server Transact-SQL? Once a cursor is declared, you need to execute the query attached to the cursor so that the result set returned from the query can be accessed through the cursor. To execute the cursor query, you should use the OPEN...
2016-10-17, 1265🔥, 0💬

Using Group Functions in the SELECT Clause in SQL Server
How To Use Group Functions in the SELECT Clause in SQL Server? If group functions are used in the SELECT clause, all rows that meet the criteria defined in the WHERE clause will be treated as a single group. The group functions will be apply all rows in that group as a whole. The final output of the...
2016-10-25, 1262🔥, 0💬

What Is a Schema in SQL Server 2005 in SQL Server
What Is a Schema in SQL Server 2005 in SQL Server? A schema is a container of database objects with the following interesting related rules: A schema may contain different object types, like tables, indexes, views, procedures, functions, etc. A database user can be assigned with a default schema. Ob...
2016-10-22, 1261🔥, 0💬

Adding More Test Data for Query Statements in SQL Server
How To Add More Data to the Testing Table in SQL Server? If you want to continue with other tutorial exercises in this FAQ collection, you need to add more data to the testing table. Follow the script below to add a new column and more rows: ALTER TABLE fyi_links ADD tag VARCHAR(8) GO UPDATE fyi_lin...
2016-10-26, 1258🔥, 0💬

Subtracting a DATETIME Value from Another DATETIME Value in SQL Server
Can a DATETIME Value Be Subtracted from Another DATETIME Value in SQL Server Transact-SQL? Can a datetime value be subtracted from another datetime value? The answer is yes. The subtract operation can be performed by the subtract operator (-) as: datetime1 - datetime2: Returning a DATETIME value cal...
2017-02-20, 1257🔥, 0💬

Joining Two Tables in a Single Query in SQL Server
How To Join Two Tables in a Single Query in SQL Server? Two tables can be joined together in a query in 4 ways: Inner Join: Returns only rows from both tables that satisfy the join condition. Left Outer Join: Returns rows from both tables that satisfy the join condition, and the rest of rows from th...
2016-10-30, 1257🔥, 0💬

Creating a New Table in a Given Schema in SQL Server
How To Create a New Table in a Given Schema in SQL Server? When you create a new table, you can specify in which schema you want this table to be located by prefixing the table name with the schema name. In the tutorial example below, a new table "test" is created in schema "fyi": USE FyiCenterData;...
2016-10-22, 1257🔥, 0💬

Transferring Tables from One Schema to Another in SQL Server
How To Transfer an Existing Table from One Schema to Another Schema in SQL Server? If you want to move an existing table from one schema to another schema, you can use the "ALTER SCHEMA ... TRANSFER ..." statement as shown in the tutorial exercise below: -- Login with "sa" USE FyiCenterData; GO -- C...
2016-10-22, 1257🔥, 0💬

DROP VIEW - Deleting Existing Views in SQL Server
How To Drop Existing Views from a Database in SQL Server? If you don't need a specific view any more, you can use the DROP VIEW statement to delete it from the database. The following tutorial exercise shows you how to delete the view, fyi_links_view: USE FyiCenterData; GO SELECT * FROM sys.views; G...
2016-11-05, 1256🔥, 0💬

Providing Column Names in INSERT Statements in SQL Server
How to provide column names in INSERT Statements in SQL Server? If you don't want to specify values for columns that have default values, or you want to specify values to columns in an order different than how they are defined, you can provide a column list in the INSERT statement. If a column is om...
2016-11-02, 1256🔥, 0💬

Deleting Data from a View in SQL Server
Can You Delete Data from a View in SQL Server? Can you delete data in a view? The answer is no. But if the question is "Can you delete data from the underlying table through view?" The answer is then yes. SQL Server will allow you to delete data from the underlying table through a view. The tutorial...
2016-11-03, 1252🔥, 0💬

<< < 43 44 45 46 47 48 49 50 51 52 > >>   ∑:1233  Sort:Date