Hard query, MySQL knowers look here.
#1

The problem is that i have 2 tables, from first table i want to select player id, and player rank from the second i need the player id which i selected in first line, so i could select correct values. I need this in one query. Is this even possible?

how far i got:
pawn Код:
(SELECT id, playerrank FROM characters WHERE faction = %i )
UNION
(SELECT Name, Last Seen FROM accounts WHERE id = {what i have to put here? if i already select id in the first line, and is this even possible?} ORDER BY Last Seen)
If you don't understand something, please ask. I need this solved as fast as possible
Reply
#2

check this, it should cover what you're asking for
http://www.techrepublic.com/article/...tables/1050307
Reply
#3

Quote:
Originally Posted by cessil
Посмотреть сообщение
check this, it should cover what you're asking for
http://www.techrepublic.com/article/...tables/1050307
Thanks, i got this far using subquery

pawn Код:
SELECT accounts.Name, accounts.Last Seen, characters.playerrank WHERE id = (SELECT id FROM characters WHERE faction = %i);
Is this going to work?
Reply
#4

Alright thanks ******, SQL is an language, MySQL is managment system.

I don't think you understood what i need here.

Tested, didn't work.

edit: i will study JOIN a bit more.
Do you mind giving an example, according to the tables and columns i pasted above?
My english skills are not the best, so i don't understand the arcticle exactly like you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)