Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6350619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:50:46+00:00 2026-05-24T21:50:46+00:00

I have the following query: SELECT ,e.EmployeeCode ,c.CompanyName ,v.Violation FROM dbo.Employee e INNER JOIN

  • 0

I have the following query:

SELECT 
,e.EmployeeCode
,c.CompanyName
,v.Violation
FROM dbo.Employee e
INNER JOIN dbo.Company c ON c.companyid = e.companyid
INNER JOIN dbo.Violation v ON v.CompanyId = e.CompanyId AND v.EmployeeId = e.EmployeeId

It returns results like the following:

EmployeeCode    CompanyName     Violation
     1             Test           32
     1             Test           12 
     2             ABC1           32

Row Count (3) <—-Not part of the results, just showing the number of rows I have.

Is there a way to return the results as so?

EmployeeCode   CompanyName    Violation
     1              Test          32
                                  12
     2               ABC1         32

Row Count (2) <—-Not part of the results, just showing the number of rows I want.

Basically I want it to show the Violations with a cariage return in the same row.

I was thinking about using the FOR XML Path, but would this work with a carriage return? And how would I even do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:50:47+00:00Added an answer on May 24, 2026 at 9:50 pm

    I would suggest to do such transformations on application level where they really makes sense for some kind of reporting stuff.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following query: SELECT COUNT(*) FROM FirstTable ft INNER JOIN SecondTable st
I have the following query: SELECT dashboard_data.headline, dashboard_data.message, dashboard_messages.image_id FROM dashboard_data INNER JOIN dashboard_messages
i have the following query SELECT DISTINCT dr.Revision FROM tblActionHeader ah INNER JOIN tblActionType
I have the following query SELECT c.cd, c.c_id FROM f f INNER JOIN s
i have following query SELECT *, count(jx_commissions.commission_amount) AS summe FROM jx_members INNER JOIN jx_commissions
I have following SQL query: SELECT Count(*) AS CountOfRecs FROM tblAccount INNER JOIN tblAccountOwner
I have the following query: SELECT c.[ClientID] ,u.[AccessId] FROM [tblClient] c INNER JOIN [tblUser]
I have the following query: select count(L.ID) from LA inner join L on (LA.leadid
I have following SQL Query SELECT * FROM KDMS_dynamic vd INNER JOIN KDMS_definition tblKDMS
I have following SQL query SELECT TOP 10000 AVG(DailyNodeAvailability.Availability) AS AVERAGE_of_Availability FROM Nodes INNER

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.