SA-MP Forums Archive
Another SQL Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Another SQL Problem (/showthread.php?tid=629009)



Another SQL Problem - RedFusion - 18.02.2017

Hello!

I have this problem with a piece of SQL code which i've been trying to solve for some time.

I have this table which contains deaths. Columns:
deathid
deadvisitid
killervisitid

I also have a table which contains visits. Columns:
visitid
ip
name

Now to the problem:
I'm trying to fetch the full details of every death in the same row, i've tried some different approaches using joins and aliases without reaching my goal.

I have managed to fetch the dead and killer details in separate rows. But what i want is to fetch all of this - deathid, dead ip, dead name, killer ip, killer name - in 1 row.

I really need some help here!


Re: Another SQL Problem - Freaksken - 18.02.2017

If both the information of the victim and killer are in the same table, you will need to perform 2 joins on that table.