Hi!
I have 4 tables (table1, table2, table3, table 4)
I need to do select * from all four table and get them sorted
all the tables have field named id, so I figured that's the field I should join all the tables with
let's say table1 has 5 records in it, and table2 has 3
when I do select I want that id from table2 starts from 6 and goes to 8
so...
when i do select the id would go from 1-8
and is there a way that i could get an id from table2(or i have to subtract id from first table(table1) from all tables....)
how do I select * from 4 tables? they all have field name id and I want to join tables using that field
i use php, so I have a variable named $t and I want to use similar query to this
$t="something" ;
SELECT * FROM table1 WHERE field1 LIKE '%$t%' OR field 2 LIKE '%$t%'
it works when I use four queries but I want to be able to join queries and get one result... and if possible I want the id field not to have duplicate values (as described, i want them to go from 1-number_of_id_fr om_table1 and then just add that number to id from table2 and so on...)
and if there's a way to get the table name, or id(i.e.from table2).... I don't know how to descibe it... but if my table1 has 3 records and table2 has 2 record, then the first id from table2 would have id=5
thx
I have 4 tables (table1, table2, table3, table 4)
I need to do select * from all four table and get them sorted
all the tables have field named id, so I figured that's the field I should join all the tables with
let's say table1 has 5 records in it, and table2 has 3
when I do select I want that id from table2 starts from 6 and goes to 8
so...
when i do select the id would go from 1-8
and is there a way that i could get an id from table2(or i have to subtract id from first table(table1) from all tables....)
how do I select * from 4 tables? they all have field name id and I want to join tables using that field
i use php, so I have a variable named $t and I want to use similar query to this
$t="something" ;
SELECT * FROM table1 WHERE field1 LIKE '%$t%' OR field 2 LIKE '%$t%'
it works when I use four queries but I want to be able to join queries and get one result... and if possible I want the id field not to have duplicate values (as described, i want them to go from 1-number_of_id_fr om_table1 and then just add that number to id from table2 and so on...)
and if there's a way to get the table name, or id(i.e.from table2).... I don't know how to descibe it... but if my table1 has 3 records and table2 has 2 record, then the first id from table2 would have id=5
thx
Comment