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.
| Author |
Topic |
|
cardgunner
326 Posts |
Posted - 2007-04-27 : 12:35:05
|
This is going to be a good one. I’m not very good at SQL. What I know I learned from a couple of books and from searching here or online. I have not found anything on what I’m trying to do. In a table (dscrp) I have fourfields(unit, spec, desc, seq). There is no primary. The results of the table look like this: unit spec desc seq ------- --------------------------- ------------------------------ ------ 26124 168 HP 126124 31590lbs. Oper. Weight 226124 3.5 Yd Class 326124 yes Coupler 426124 yes Ride Control 526124 23.5x25 L-3 Michelin XHA Tires 626124 yes Aux Hyd 726124 Counterweight,Beacon Other Options 870222 17,700lbs Operating Weight 170222 61hp Horse Power 270222 18" Rubber Tracks 370222 89" 2 way Dozer Blade 470222 14'9" Dig Depth 570277 185hp Horse Power 170277 84" Drum Size 270277 33810lbs Operating Weight 3 What I'm trying to achieve isunit description--------------- ------------------------------------------------------------26124 168hp, 31590lbs. Oper. Weight, 3.5Yd Class, Coupler, Ride Control, 23.5x25 L-3 Michelin XHA Tires, Aux Hyd, Counter weight,Beacon70222 17,700lbs. Operating Weight, 61hp Horse Power, 18" Rubber Tracks, 89" 2 way Dozer Blade, 14'9" Dig Depth70277 185hp Horse Power, 84" Drum Size, 33810lbs Operating Weightsome of the logic I'd like other then how to get all of this toogether isCASE WHEN spec IN ("yes" or "no") THEN '' ELSE spec ENDCASE WHEN desc="Other Options" THEN '' ELSE spec ENDtable dscrp will be joined to table main by unitwhere as my final result would be, as an example:unit year make model description price---- ---- ---- ----- ----------------------------------------- -----26124 2005 IR DD110 168hp, 31590lbs. Oper. Weight, 3.5Yd $123,000 Class, Coupler, Ride Control, 23.5x25 L-3 Michelin XHA Tires,Aux Hyd, Counterweight ,BeaconAny Help on combining spec and desc in order in a text string per each unit.From Pressure Comes DiamondsCard Gunner |
|
|
cardgunner
326 Posts |
Posted - 2007-04-27 : 12:39:18
|
| Shoot the tabs in this didn't work. I'll try reposting so it makes more senseCard Gunner |
 |
|
|
|
|
|
|
|