combine 2 sql statement into 1 (1 reply)

This Comment will be submitted for moderation and will not be accessible to other users until it has been approved.
Submitted by programmer on Thu, 08/14/2008 - 14:56.

how to combined the below 2 statement into 1 ?

SELECT CONCAT_WS(' ',su.firstName,NULL,su.lastName) as fullName ,

CONCAT_WS(',',fnet.userId,NULL,fnet.friendId) as id , fnet.status as status

from

friends_network fnet join security_user su

on fnet.userId = su.id and fnet.friendId like 'userABC'

SELECT CONCAT_WS(' ',su.firstName,NULL,su.lastName) as fullName ,

CONCAT_WS(',',fnet.userId,NULL,fnet.friendId) as id , fnet.status as status

from

friends_network fnet join security_user su

on fnet.friendId = su.id and fnet.userId like 'requester'

Post Comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.