I'm created two table first one is test1 and second one is test2. In first table one field is id and in second table one field is id. in first table two data/value insert 1 and 2 and second table four data/value insert 1, 2, 3 and 4 I want to acess only 3 and 4 data with use join key how can do this??????????? plz help me.....................
Hi friends i am bunty & i thinks an internet is a big & broad way to get our solution about any kind of problem in daily life
yes some thing like this but in case here its database content which are not static. I want to select only these data which are not available in other table In case i can't define like select table1.*, table2.* where table1.id=table2.id and table2.id in (3,4) because 3 and 4 is not static its changeable then how can retrive data ???????????? plz reply me
You need a left join and then a WHERE clause to find those that are null in the second table. Something like: SELECT * FROM table1 LEFT JOIN table2 ON table1.id = table2.id WHERE table2.id = NULL I haven't tested that SQL out, so there might be a syntax error or two, but that's the general idea of how you find all the records in one table without matches in the second.
The JOIN keyword is used in an SQL statement to query data from two or more tables, based on a relationship between certain columns in these tables. if both the tables haved some same columns then we can combine them if we r having two tables then we can combine them as example: SELECT column_name(s) FROM table_name1 INNER JOIN table_name2 ON table_name1.column_name=table_name2.column_name