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 |
|
u2p_inst
Yak Posting Veteran
78 Posts |
Posted - 2002-10-30 : 02:39:12
|
| dear all,i want create view from table like thisFLD1 FLD2 FLD3 FLD4 FLD5---- ---- ---- ---- ----KG ONBS 23 12 FLD4-FLD3KG SBI 33 56 FLD4-FLD3KG ONBS 34 45 FLD4-FLD3KG CIM 34 45 FLD4-FLD3KG NTB 65 44 FLD4KG ONBS 56 65 FLD4-FLD3KG OFFS 32 3 FLD4KG OFFS 66 45 FLD4KG CIM 2 67 FLD4-FLD3KG NTB 65 56 FLD4KG NTB 34 87 FLD4KG OFFS 75 34 FLD4KG SBI 76 45 FLD4-FLD3KG SBI 23 76 FLD4-FLD3KG OFFS 89 78 FLD4Please help me out...oh |
|
|
Crespo
85 Posts |
Posted - 2002-10-30 : 03:01:22
|
OK.. but which columns you want to include in your view though? You mention the the table with 5 columns but do you want to create a view of the whole table? What conditions do you need?You really have to be more specific in your question I'm afraid otherwise we can't help you much. Best Regards.Crespo.Hewitt Bacon & WoodrowEpsomSurreyUnited Kingdom |
 |
|
|
u2p_inst
Yak Posting Veteran
78 Posts |
Posted - 2002-10-30 : 03:46:21
|
| FLD1 FLD2 FLD3 FLD4 FLD5 ---- ---- ---- ---- ---- KG ONBS 23 12 FLD4-FLD3 KG SBI 33 56 FLD4-FLD3 KG ONBS 34 45 FLD4-FLD3 KG CIM 34 45 FLD4-FLD3 KG NTB 65 44 FLD4 KG ONBS 56 65 FLD4-FLD3 KG OFFS 32 3 FLD4 KG OFFS 66 45 FLD4 KG CIM 2 67 FLD4-FLD3 KG NTB 65 56 FLD4 KG NTB 34 87 FLD4 KG OFFS 75 34 FLD4 KG SBI 76 45 FLD4-FLD3 KG SBI 23 76 FLD4-FLD3 KG OFFS 89 78 FLD4 i want create view which the conditions are:1. FLD5(field) is FLD4-FLD3 if FLD2 = ONBS,SBI,CIM2. FLD5(field) is FLD4 if FLD2 = NTB, OFFSTHANKSoh |
 |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2002-10-30 : 05:27:44
|
| (forum) search here for example of "CASE" statements....there's plenty of examples already here, which will solve your problem.....(it's not difficult, but you'll learn far more by searching, reading, understanding and applying what you find than if we just give you the code) |
 |
|
|
|
|
|