select syntax with two tables I have a problem with a syntax of "select" with two tables. i have two
tables:
create table users1
(
id_user1 int unsigned not null auto_increment primary key,
login char(30) not null,
pass char(40) not null,
e_mail char(70) not null
etc...
);
create table users2
(
id_user2 int unsigned not null auto_increment primary key,
login char(30) not null,
pass char(40) not null,
etc....
);
and when someone want to log into my site I have to check his login
and password so I need some syntax to sum together this tables and
then check if login and password of this guy is in this sum (I nedd to
do this in one syntax). so i try to do this in this way:
select login, pass from (select login,pass from users1) union (select
login,pass from users2) where login="some_guy" and
pass=sha1("some_password");
but it doesnt work
only
(select login,pass from users1) union (select login,pass from users2)
works and display content of this two tables together.
I dont know how to do this. enybody knows?? help :-)
select login, |