Logo SQLinForm

 

Number of "identifiers per line"

Number of "identifiers per line"
March 30, 2009 03:29PM
SQL with 4 identifiers per line
 SELECT col1          , col2          , col3          , col4          ,
        col5          , col6          , col7          , tablecolumn8  ,
        tablecolumn9  , tablecolumn10 , tablecolumn11 , tablecolumn12 ,
        tablecolumn13 , tablecolumn14 , tablecolumn15 , tablecolumn16 ,
        tablecolumn17 , tablecolumn18 , tablecolumn19 , tablecolumn20 ,
        tablecolumn21 , tablecolumn22 , tablecolumn23 , tablecolumn24 ,
        tablecolumn25 , tablecolumn26 , tablecolumn27 , tablecolumn28 ,
        tablecolumn29 , tablecolumn30
 FROM   foo

Same SQL with 1 identifier per line
 SELECT col1          ,
        col2          ,
        col3          ,
        col4          ,
        col5          ,
        col6          ,
        col7          ,
        tablecolumn8  ,
        tablecolumn9  ,
        tablecolumn10 ,
        tablecolumn11 ,
        tablecolumn12 ,
        tablecolumn13 ,
        tablecolumn14 ,
        tablecolumn15 ,
        tablecolumn16 ,
        tablecolumn17 ,
        tablecolumn18 ,
        tablecolumn19 ,
        tablecolumn20 ,
        tablecolumn21 ,
        tablecolumn22 ,
        tablecolumn23 ,
        tablecolumn24 ,
        tablecolumn25 ,
        tablecolumn26 ,
        tablecolumn27 ,
        tablecolumn28 ,
        tablecolumn29 ,
        tablecolumn30
 FROM   foo



Edited 2 time(s). Last edit at 03/30/2009 03:31PM by guidomarcel.
Can we have more than 4 identifiers per line? Up to 16 would be cool, or user defined number.
Some queries we write can have quite a few columns.
Re: Number of "identifiers per line"
October 26, 2012 01:58PM
SELECT
PT.TaskID,
PT.TaskName,
ISNULL(T.TT,'') ,
ISNULL(PT.TTID,0) ,
ISNULL(S.STTID,'') ,
ISNULL(PT.STTIDD,0) ,

ISNULL(A.ActivityType,''),
PT.Description,
PT.IA,
PT.IP,
PT.PRJ,
P.ProjectCode AS ProjectName,
--ISNULL(PSP.SubProjectName, '') AS SubProjectName,
--ISNULL(PM.ModuleName, '') AS ModuleName,
ISNULL(PT.ActivityTypeID, 0),
PT.EstimatedHours,
0 AS 0,
CONVERT(VARCHAR,PT.StartDate, 106),
CONVERT(VARCHAR,PT.EndDate, 106) ,
ISNULL(PT.IsForGroup, 0),
PT.TeamLeads AS TeamLeads,
PT.Comments as Comments,
PT.CreateDate as CreateDate,
ISNULL((SELECT Count(Distinct(EmployeeID))
FROM PTA WHERE TaskID = PT.TaskID AND ProjectID = PT.ProjectID), 0) AS
Author:

Your Email (Optional):


Subject:


Spam prevention:
Please, solve the mathematical question and enter the answer in the input field below. This is for blocking bots that try to post this form automatically.
Question: how much is 3 plus 20?
Message: