• TRACIEJOHNSON30 (10/9/2013)


    I need some assistance....I have the screen shot attached below. I would like the output to have column headers 'vessel' and each of the twelve months. I would like to have a 'po number' count for every month for each 'vessel'

    Hi and welcome to the forums. It is best if you start your own thread instead of hijacking a 2 year old thread. Also, this is a sql server site, not a MySql site, so you will find that the syntax we come up with will work for sql server. It may not work for MySql. Last but not least, on any technical forum where you post for help you need to provide enough information for people to be able to help. A screen shot of a query does not offer much in the way of detail. You should instead include:

    1. Sample DDL in the form of CREATE TABLE statements

    2. Sample data in the form of INSERT INTO statements

    3. Expected results based on the sample data

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/