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 8539787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:26:59+00:00 2026-06-11T11:26:59+00:00

WHat i want is concate the static string to dataset i want to add

  • 0

WHat i want is concate the static string to dataset i want to add string as min, avg, max to the fetched data. when i m trying give some error?

my query

select m.medTitle, 
min(TIMESTAMPDIFF(SECOND, s.dmtViewStart, s.dmtViewEnd)) playtime
from tbldoctormediatracktest s
left join tblmedia m on s.dmtMedId = m.medId
group by m.medTitle
union all
select m.medTitle, 
avg(TIMESTAMPDIFF(SECOND, s.dmtViewStart, s.dmtViewEnd)) playtime
from tbldoctormediatracktest s
left join tblmedia m on s.dmtMedId = m.medId
group by m.medTitle
union all
select m.medTitle, 
  max(TIMESTAMPDIFF(SECOND, s.dmtViewStart, s.dmtViewEnd)) playtime
from tbldoctormediatracktest s
left join tblmedia m
  on s.dmtMedId = m.medId
group by m.medTitle
order by medTitle,  playtime;

what i am trying.

select concat(m.medTitle,'minimum'), 
  min(TIMESTAMPDIFF(SECOND, s.dmtViewStart, s.dmtViewEnd)) playtime
from tbldoctormediatracktest s
left join tblmedia m
  on s.MedId = m.MedId
group by m.medTitle
union all

select concat(m.medTitle,'average'), 
  avg(TIMESTAMPDIFF(SECOND, s.dmtViewStart, s.dmtViewEnd)) playtime
from tbldoctormediatracktest s
left join tblmedia m
  on s.MedId = m.MedId
group by m.medTitle
union all

select concat(m.medTitle,'maximum'),  
  max(TIMESTAMPDIFF(SECOND, s.dmtViewStart, s.dmtViewEnd)) playtime
from tbldoctormediatracktest s
left join tblmedia m
  on s.MedId = m.MedId
group by m.medTitle
order by medTitle,  playtime
  • 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-06-11T11:27:00+00:00Added an answer on June 11, 2026 at 11:27 am

    try this:

    select playtime,type 
    from(
    select m.MedId, 
      min(TIMESTAMPDIFF(SECOND, s.dmtViewStart, s.dmtViewEnd)) playtime,
      concat(m.medTitle,' (minimum)') as type
    from tbldoctormediatracktest s
    left join tblmedia m
      on s.MedId = m.MedId
    group by m.MedId
    union all
    
    select m.MedId, 
      avg(TIMESTAMPDIFF(SECOND, s.dmtViewStart, s.dmtViewEnd)) playtime,
      concat(m.medTitle,' (average)') as type
    from tbldoctormediatracktest s
    left join tblmedia m
      on s.MedId = m.MedId
    group by m.MedId
    union all
    
    select m.MedId,  
      max(TIMESTAMPDIFF(SECOND, s.dmtViewStart, s.dmtViewEnd)) playtime,
      concat(m.medTitle,' (maximum)') as type 
    from tbldoctormediatracktest s
    left join tblmedia m
      on s.MedId = m.MedId
    group by m.MedId)a
    order by MedId,  playtime
    

    SQL Fiddle domo 1

    SQl Fiddle Demo 2

    SQL Fiddle Demo 3

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

Sidebar

Related Questions

How can i concate this string in mysql desc=desc+$desct what i want is each
want to know why String behaves like value type while using ==. String s1
Suppose you have a Java method void foobar(int id, String ... args) and want
I want to concat two Columns in the TableAdapter Wizard of the VS Dataset-Designer.
I have a dataset which I want to use as a parameter for my
I want to select all posts that contain a specific tag. I'm trying it
I know its very easy to split data in strings, but still i want
I'm working with Mac OS X 10.7.5 and I'm using Grunt to concate some
I am getting some data from database that has date break up in year
Say that I have public static class M { public static string Concat(string a,

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.