0
 select concat_ws((
select count(*) from feed_back where schedule_id=1),'/',(select count(*) from event_schedule_mapping where event_schedule_id=1))
as total

i am getting count from both query but when i try to concat it using concat_ws its give me blobdata as blank please tell me where am doing wrong please suggest.

1

3 Answers 3

0

Why concat_ws() and not concat() ?

SELECT CONCAT( (First Select),
                '/'
               (Second Select)) as total
Sign up to request clarification or add additional context in comments.

1 Comment

same thing i did then also same issue still am getting Blob type data with blank
0

Try this, using the separator first:

    SELECT CONCAT_WS('/', 
        (select count(*) from feed_back where schedule_id=1), 
        (select count(*) from event_schedule_mapping where event_schedule_id=1))

String Functions - MySQL CONCAT_WS

3 Comments

Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select count() from feed_back where schedule_id=1),'/', (select count() from ev' at line 1
try running each query separately, to see the values that returns, look at this example. Is a simple function, you should not have any problem.
looking for a bit, I found this, you could try it and let me know
0

Try Like this

SELECT sum(a+b) as total FROM (SELECT count(*) as a from feed_back where schedule_id=1) as x, (SELECT count(*) as b FROM event_schedule_mapping where event_schedule_id=1) as y

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.