Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 retrieving from computed column!?

Author  Topic 

netcop
Starting Member

12 Posts

Posted - 2002-07-22 : 10:02:18
Hello,

i have a question regarding my database design. I got the data from ascii and imported it straight into the database.

I've a table where information to a busline is stored.
There are some profiles (f1....fx) where the time from
the starting point is stored.

Line Direction busstop distance f1 f2 f3
========================================================
70 1 001 0000 00 00 00
70 1 123 0326 02 03 01
70 1 136 0629 04 05 03
70 1 222 0980 05 06 04
70 1 234 1234 06 07 05
70 1 235 1612 07 09 06
70 1 180 1902 10 12 08
70 1 221 2345 12 15 10
70 1 110 2680 15 17 12


In another table the time information is stored.

line direction starttime profile
=====================================
70 1 06:11 1
70 1 06:30 1
70 1 07:11 2
70 1 07:30 2
70 1 08:11 2

In this table there is the information which profile i've to choose (f1...fx). If there stands 1 then f1 is to use.

How to combine this in one single sql-statement without using dynamic sql!?





Edited by - netcop on 07/22/2002 14:51:15

Edited by - netcop on 07/24/2002 09:21:22

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2002-07-23 : 04:33:08
Look up the CASE statement in BOL..

Peace

Rick

Go to Top of Page

netcop
Starting Member

12 Posts

Posted - 2002-07-24 : 09:17:45
Thanks. The query runs with the CASE statement.

Go to Top of Page
   

- Advertisement -