March 5, 2010 at 7:25 am
Hello,
I need some designhelp with table/tables.
I have an excel matrix as the picture. rows are km, and columns are distance. fields are prices.
Indata from user is km and distance. How can i return price to user? Not sure how to design table/s
March 5, 2010 at 12:56 pm
CREATE TABLE tbl (km INT NOT NULL, distance INT NOT NULL, price INT NOT NULL, PRIMARY KEY (km,distance));
March 6, 2010 at 1:24 am
ok thats one way of doing it 🙂
March 6, 2010 at 10:00 am
Thats probably the best way to do it. Except that I'd make "Distance" a range, that is, two int columns: MinDistance, MaxDistance. (change it in the PK too).
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply