2011-01-17
As an aid memoir; Firstly, to create stored procedures in MySQL you need to temporarily change the line delimiter so you can add code with normal delimiters without delimiting what you're currently doing.
Secondly, in order to use variables passed into a procedure you need to concatenate into a...
2009-03-24
As of My Sql 3.something you can now add text indexes to your columns and do full text searches with relevance ranking! text indexes are fantastic and allow more efficient searching and categorisation of text. The relevance ranking feature is rather good too and gives you a much better idea of how y...
2008-12-08
sql
SERVEROUTPUT ON
declare
result_limit number := 10;
current_query_no number := 1;
--table_n varchar2(30) := 'brian.cran1400_der_results';
--cursor all_results is select * from brian.cran1400_der_results;
cursor result_list(counter number) is select * from brian....
2008-05-30
if you can't track down all the life connections and you need to force changes:
use master
alter database db_name set offline with rollback immediate...
2008-03-19
http://weblogs.sqlteam.com/jeffs/archive/2007/08/23/composite_primary_keys.aspx...
2008-03-07
As a point of reference
how to convert a comma delimited file to an SQL insert
Assuming your data is the following
'key','value','0'
'key','value','1'
In notepad++ the syntax for search and replace would be as follows:
search: ('[^']+','[^']+','[^']+')
replace: (\1)
syntax varies d...
2008-02-26
based on
ORDER_TRANSACTION
__________
1|ORDER__|
2|CREDIT__|
3|REFUND_|
4|PAYMENT|
Instead of the following:
SELECT
ot
FROM
OrderTransaction
AS
ot
WHERE
ot.transactionType.transactionTypeDesc = 'Credit'
OR
ot.transactionType.transactionTypeDesc = 'Refund'
OR
ot.transac...
2008-01-16
SELECT
SUM(p.orderTransaction.transAmount)
FROM
Payment AS p
...
2007-08-27
SELECT * FROM
crh_houses
LEFT JOIN
crh_p_tags
ON
crh_houses.house_id = crh_p_tags.house_id
WHERE
crh_houses.house_id = 3
UNION DISTINCT
SELECT
*,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL
FROM
crh_p_tags WHERE crh_p_tag...
2007-08-06
SELECT
*
FROM
holiday_dates
LEFT JOIN
holiday_rentals
ON
holiday_rentals.week = holiday_dates.week
AND holiday_rentals.house_id = 3
GROUP BY holiday_dates.week...