Posts Tagged ‘MySQL’

MySQL v. MS SQL Server Information Schema Queries

In MySQL, you would run the following to get information on tables in a database:
SELECT * FROM information_schema.tables
WHERE table_schema = ‘YourDatabaseName’;
In MS SQL Server, the same would be:

USE YourDatabaseName
SELECT * FROM INFORMATION_SCHEMA.tables;
– See more at: http://dbadiaries.com/querying-information_schema#sthash.aQp6qbaP.dpuf

Quick Tip: MS SQL TOP = MySQL Limit

 The MS SQL equivalent of MySQL’s LIMIT clause is TOP. Example:
SELECT TOP 10 * FROM stuff;
Will return the top ten rows, effectively doing the same thing as
SELECT * FROM stuff LIMIT 10;

Quick-Tip: Set MySQL PATH in 1 Line

export PATH=$PATH:/full/path/to/mysql