开发者

Adding a type of heading to a query

开发者 https://www.devze.com 2023-01-19 13:18 出处:网络
Hey all, im not sure if this is possible but i am looking to add a heading to a query\'s output. The best way to describe this is just by showing what i would like the output to look like:

Hey all, im not sure if this is possible but i am looking to add a heading to a query's output. The best way to describe this is just by showing what i would like the output to look like:

[heading here]
<skip row>
[Another Header here]
MemebersID | FirstName | LastName | Email              | OrderDate
05466        Bob         Barker     Bob@aol.com          2010-05-11
05946        Jan         Lowers     JLo@aol.com          2010-09-11
06456        Tony        Montana    TonyM@aol.com        2010-01-11

So here's what it would look like with the headers in place:

Top Users Records

The Memebers
MemebersID | FirstName | LastName | Email              | OrderDate
05466        Bob         Barker     Bob@aol.com          2010-05-11
05946        Jan         Lowers     JLo@aol.com          2010-09-11
06456        Tony        Montana    TonyM@aol.com        2010-01-11

Is that possible as the output of a query using MS SQL 2005?

@KM

Because the report looks like that when all sa开发者_StackOverflow社区id and done....

Top Users Records

The Memebers
MemebersID | FirstName | LastName | Email              | OrderDate
05466        Bob         Barker     Bob@aol.com          2010-05-11
05946        Jan         Lowers     JLo@aol.com          2010-09-11
06456        Tony        Montana    TonyM@aol.com        2010-01-11

The Users
MemebersID | FirstName | LastName | Email              | OrderDate    | Bill
05466        Bob         Barker     Bob@aol.com          2010-05-11     $5.66
05946        Jan         Lowers     JLo@aol.com          2010-09-11     $95.05
06456        Tony        Montana    TonyM@aol.com        2010-01-11     $9.02

Any help would be great! Thanks :)


Adding formatting headings to the query is really an application issue, with not much you can do in TSQL, this is about the best you can do:

PRINT '[heading here]'
PRINT ' '
PRINT '[Another Header here]'
SELECT ....
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号