Skip to content

Commit

Permalink
Added an SQL View for calculating links between stars
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Aug 25, 2014
1 parent 08b7c23 commit 0185c28
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dataseed/dbdef.sql
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,14 @@ CREATE TABLE
ON DELETE CASCADE
) WITHOUT ROWID
;

CREATE VIEW
vLink
AS
SELECT lhs.system_id AS from_system_id
, rhs.system_id AS to_system_id
, calc_distance_sq( lhs.pos_x, lhs.pos_y, lhs.pos_z
, rhs.pos_x, rhs.pos_y, rhs.pos_z)
AS distance_sq
FROM System AS lhs, System AS rhs
;

0 comments on commit 0185c28

Please sign in to comment.