My rogue character uses a skirmishing style in melee, but he is pretty unique and kinda complex. Long post ahead, if you want the summary, just skip to the last paragraph. The next three are just my personal experience and demonstration of a melee rogue.
First of all, he is a Fighter (Battlemaster 3) / Rogue (Swashbulker 6) with Dawnbringer, which is essentially a finesse longsword. The swashbulker levels gives me plenty of mobility options. I can use Fancy Footwork to move away from any target I attacked for free. If there are more enemies around me, I can use a bonus action disengage. Basically I can go in, strike hard, and move away with no opportunity attacks.
Now here's where he gets a bit different from your normal rogue. He picked up magic initiate at Rogue 4, so he has booming blade. So he can essentially go up to a target, booming blade them, apply sneak attack on a hit with his finesse sword, and then move away. So then the target has to move to attack someone and will take the extra thunder damage. Booming blade is a great boon for melee skirmish type rogues for these reasons.
The final icing on the cake is the fighter levels, giving him a few benefits. Second wind and the extra HP provide some durability for staying in melee (Uncanny Dodge helps too!). The maneuvers help him take things down quickly and effectively (Precision helps him hit, Riposte for another helping of sneak attack when he's missed). And then there's the fighting style--which in his case is Great Weapon Fighting, but I can see most rogues going for two-weapon fighting for melee or archery for range. But fortunately, Dawnbringer wielded in two hands lets him reroll all damage with any melee attack (usually 1d10+1d8+3d6+5). He still doesn't do nearly as much damage as a crossbow expert/sharpshooter rogue, but I find it interesting and more engaging to perilously dance in and out of melee. Plus rolling that many dice and getting to reroll the low ones is quite fun and makes an attack feel more successful.
In conclusion, I'd say the ranged rogue is safer and easier to use; plus the skirmishing melee rogue doesn't get better until later levels and may require some multiclassing. It requires more tactical thought and understanding to use a rogue in melee and survive. Even then, it only becomes fairly workable around level 2-3 (rogue 2 ~ fighter 1). You need rogue 2 for the mobility and 1 fighter level helps with the early survivability. Then getting access to booming blade and Uncanny Dodge (magic initiate, eldritch knight, or high elf) comes later for the most part. And if you don't have access to the SCAG, some of the best melee rogue options aren't available to you.