Fix a SQL Statement

$10.00 (inc. GST Australia)

Categories: ,


Are you having trouble creating a SQL statement to do something important, or is it not running fast enough?

Send me the statement and I will have a go at fixing it.

You have to contact me via email (see contact form).

When you send me the SQL statement, if it is a SELECT statement don’t forget to send me the data too.

You can do this via a Common Table Expression (CTE) as follows:

WITH data AS (
/* Oracle ....*/
SELECT SDO_GEOMETRY('LINESTRING(0 0,1 1)',28355) as ora_geom FROM DUAL UNION ALL .....
/* SQL Server */
SELECT GEOMETRY::STGeomFromText('LINESTRING(0 0,1 1)',28355) as ss_geom FROM DUAL UNION ALL .....
/* PostGIS */
SELECT ST_GeomFromText('LINESTRING(0 0,1 1)',28355) as pg_geom FROM DUAL UNION ALL .....
SELECT columns.....
FROM data a;


There are no reviews yet.

Be the first to review “Fix a SQL Statement”

Your email address will not be published. Required fields are marked *