Author |
Topic |
sg2255551
Constraint Violating Yak Guru
274 Posts |
Posted - 2006-07-25 : 22:53:56
|
hiHow do i retrieve columns that starts with for example letter F and A and BI have tried something like:Select F.*, A.*, B.* from tblDemoBOL does not have anything on that.Thanks |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-07-25 : 23:11:30
|
You have to give the name of the column in your select. You can't use a wildcard.CODO ERGO SUM |
|
|
sg2255551
Constraint Violating Yak Guru
274 Posts |
Posted - 2006-07-25 : 23:20:52
|
hiI have a table with dynamic columns meaning every month it increases by maybe about 40. I have created a view which excel would connect to for pivot table. Initially i have select all columns that start with F,A and B but as it increases, i do not want to administter in the view by reselecting it. Is there anyway? Thanks |
|
|
LoztInSpace
Aged Yak Warrior
940 Posts |
Posted - 2006-07-26 : 01:45:56
|
Normalise your data. You are clearly missing some additional data and are trying to substitute it using the column name.At your present rate, you'll have an unmanageable and possibly uncreatable table within a year. |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2006-07-26 : 08:47:03
|
Holy crap. That is a *horrible* design. Please follow LztInSpace's advice and normalize your data. You'll be amazed at how much easier things are to do with a good database design. In addition, Excel Pivot Tables are designed to take normalized data and to "pivot" it into summarized data in columns. See: http://www.datamodel.org/NormalizationRules.html- Jeff |
|
|
mahesh_bote
Constraint Violating Yak Guru
298 Posts |
Posted - 2006-07-26 : 08:52:31
|
try it...Select O.Id, C.Name From SysObjects As O, SysColumns As CWhere O.Id = C.Id And O.XType = 'U'And (C.Name Like 'A%' Or C.Name Like 'B%' Or C.Name Like 'F%')BMahesh |
|
|
mahesh_bote
Constraint Violating Yak Guru
298 Posts |
Posted - 2006-07-26 : 08:54:56
|
if u want to retrive from specific table, u can provide table name also.Select O.Id, C.Name From SysObjects As O, SysColumns As CWhere O.Id = C.Id And O.XType = 'U'And (C.Name Like 'A%' Or C.Name Like 'B%' Or C.Name Like 'F%')And O.Name = '<U'r Table Name>'BMahesh |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
|
|