Quality Testing

Quality is delighting customers

How can we retrieving data from multiple tables without using SELECT in mysql?

Hi,

How can we retrieve data from 2 tables without using Joins in mysql?

Mythri

Views: 3942

Reply to This

Replies to This Discussion

Use alias/nested queries

 

Example :

Select a.employeename, b.departmentname from employee a, department b where a.departmentid = b.departmentid;

BTW, the question title is incorrect. We cannot retrieve anything without using "Select" ;)

 

Regards,

Arvi, QTPhelp.com

Check out some cool VB/QTP code sinppets here

@Arvi

question was How can we retrieve data from 2 tables without using "Joins" in mysql?

without using joins.

you mentioned in example the inner join.

is it true????

 

AFAIK using join means using the "join" keyword in select queries to retrieve data from two tables. In the above query I have not used it.

Example using join:

SELECT column_name(s)
FROM table_name1
INNER JOIN table_name2
ON table_name1.column_name=table_name2.column_name

Please let me know if you have any more questions.

Regards,
Arvi, QTPhelp.com

 

 Arvi,

 

 It makes me laugh ... If I am not wrong,  What you have used is indeed Join... but in 1st example you have written it in Theta style and in 2nd Example ( Which According to you is a join ) You have written the same query in ANSI Style..........!!

Thanks Samrat, my bad. Its more than 2 yrs since I wrote a query. I had written the queries using implicit and explicit joins. But, the point here is not about Theta / ANSI styles definately. 

JFYI, I have provided the query to retrieve data from 2 tables without using joins in a response below.

yes now i remember there are different syntax for same queries but both are joins weather he used join or not.i think subquery is the right answer.

Hi Arvi,

I have idea about join but few doubts regarding this -

Inner join, euai join and Simple join is same? because oracle support simple join while SQL server ,MySQL support Inner join.

Please clear it .

Thanks

Hitesh

:) yes ,i have a doubt you explained 2 example 1 with join and 1 without join.

but both are the inner joins.

on oracle we used symbol like for right join we used (+) operator.

but if we want same cmd in other database then we used "right join" keyword.so im confused at last it is a join that you used.

The result produced will be same as that of Join, but we have not used the "Join" keyword.  You can probably say it is an implicit Join notation we have used, and this is the only way I know of to retrieve data from 2 tables without using the "Join" keyword.

 

Regards,

Arvi, QTPhelp.com 

ok thanks a lot

by the way how much exp you have in testing???

You are welcome.

7 1/2 yrs

 

-Arvi

:) g8t

 

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2022   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service