|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
problem with subquery in MySQL Hi, I am new to MySQL & I have been working with MsAccess so I want to pass this query in MySQL but I am not sure. So please help. This is my query: Code: Select * from Employees where ID="Select Max(ID) from salary"; |
#2
| |||
| |||
Re: problem with subquery in MySQL Yes MySQL supports subqueries. A subquery is, in essence, a SELECT statement that is most often used as part of another SELECT statement, but could also be used with an INSERT, UPDATE, or DELETE and other statements. Subqueries are used in order to achieve very complex searches and complex reports, as well as for various optimizations. You can use a subquery in the FROM clause of a SELECT to allow you to have essentially any number of GROUP BY clauses to further and further refine your result. What version of MySQL is running on your server? Older versions don't support subqueries, at all. Here is what you need to do. Code: SELECT * FROM table1 WHERE column1 = (SELECT column1 FROM table2); |
#3
| |||
| |||
Re: problem with subquery in MySQL Hey this is what happened with me when I had started with MySql. but I had different problems since I needed to do inner & outer joins which was more complex. The guide is really helpful. All the best. I have a question which is related with subqueries. I want to ask if I have multiple tables & a complex subquery then is there anyway to get rid of subqueries? |
#4
| |||
| |||
Re: problem with subquery in MySQL I don't think there is any alternative to subqueries. & why you want to avoid it? I think if you put your problem in detail here with the code then it will be a lot helpful to guide you. Thanks. |
![]() |
|
Tags: mysql, subquery |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
MySQL 9.04 to 9.10 problem | Flacos | Operating Systems | 5 | 24-04-2010 05:31 AM |
Mysql problem | GlassFish | Software Development | 5 | 15-12-2009 02:07 PM |
Mysql Error : Can't connect to local mysql server through socket ' var lib mysql mysql.sock' 2 | roshan45 | Software Development | 3 | 07-11-2009 09:36 PM |
Implement subquery for a database | kelfro | Software Development | 3 | 06-11-2009 10:28 PM |
Problem connecting to mysql | Damodar | Software Development | 3 | 25-02-2009 03:16 PM |