Have no idea if this sounds like possible, I'm searching a writing social networking-esque code but need a little of help.

SELECT wall.Wid, wall.uid, wall.wcomment, wall.name, comment.wid, comment.comment,comment.wid 
FROM wall 
LEFT JOIN comment ON wall.Wid=comment.wid 
WHERE wall.uid in (SELECT fid from friends where uid = 3) 

Cheers men

growing as answer :

it isn't really simple to do in SQL, especially not restricting both wall posts AND comments. you may be best carrying this out inside a loop, locating x wall posts as well as each one of these locating y comments. that method for you to also cache your comments ought to for every publish and save locating them every time.

you can limit only the count of wall posts such as this :

SELECT wall.Wid, wall.uid, wall.wcomment, wall.name, comment.wid, comment.comment, comment.wid
FROM wall LEFT JOIN comment ON wall.Wid=comment.wid 
WHERE wall.Wid in (SELECT Wid FROM wall WHERE wall.uid IN (SELECT fid from friends where uid = 3) LIMIT 0, 10)

keep in mind this is fairly inefficient, since for every comment you will be locating the wall publish, therefore if a wall publish has 10 comments you will get the wall publish data 10 occasions, every time having a different comment. i suggest you get it done inside a loop with caching.

I am a scummy MSSQL person, so I am inferring that somethign likethis works in MySQL...

SELECT
   wall.Wid,
   wall.uid,
   wall.wcomment,
   wall.name,
   comment.id,
   comment.comment,
   comment.wid
FROM
   wall
LEFT JOIN
   comment
      ON comment.id IN (SELECT id FROM comment WHERE wid = wall.wid ORDER BY id DESC LIMIT 4)
WHERE
   wall.uid IN (SELECT fid from friends where uid = 3)
   AND wall.Wid IN (SELECT Wid FROM wall ORDER BY Wid DESC LIMIT 30)

Note: MSSQL Server has become excellent at optimising IN conditions to do equally well as joins. I've no clue about MySQL's performance in connection with this.

EDIT:

If you cannot use LIMIT in this way, you would then appear to have to write a question that will get all of the comments, however then add condition to get rid of those you don't want. This could appear to involve calulating a "row number" for every comment, that we are only able to think about doing in a single way, which might not be particularly efficient...

SELECT
   wall.Wid,
   wall.uid,
   wall.wcomment,
   wall.name,
   comment.id,
   comment.comment,
   comment.wid
FROM
   wall
LEFT JOIN
   comment
      ON comment.wid = wall.wid
      AND 4 >= (
               SELECT
                  COUNT(*)
               FROM
                  comment AS [newer_comment]
               WHERE
                  [newer_comment].wid = comment.wid
                  AND [newer_comment].date_added > comment.date_added
               )
WHERE
   wall.uid IN (SELECT fid from friends where uid = 3)
   AND 30 >= (
             SELECT
                COUNT(*)
             FROM
                wall AS [newer_wall]
             WHERE
                [newer_wall].uid IN (SELECT fid from friends where uid = 3)
                AND [newer_wall].date_added > wall.date_added
             )

NOTE: I have added a [date_added] area to both [wall] and [comment] tables for use for identifying an order through which you are choosing the "first 30" records...

With this to become even remotely efficient it's imperative that indexes are put into result in the COUNT(*) sub queries as quickly as possible.

There's your final (more complicated, but possibly more intelligent and efficient, version I'm able to sumit later today, however i have to return to work now. If the matches your needs I'll publish that 'better' version)

Here are a few ways to get this done -How to select TOP N rows from a table for each group?