I have a "stuck in a rut question."
Now, keep in mind that I am coming from the MS Access database world trying to
now work in the MySQL world.
In Access I am accustomed to writing a query "Query A" that takes a
"non-hard coded" parameter, like "[Enter City]" and then using that query
in yet another query "Query B". When I run the second query "Query B" I
will be prompted for "[Enter City]" and then get my record set from
"Query A" that used records from "Query B".
I have been converting my MS Access queries to MySQL's SQL code which I
have actually become good at, believe it or not. But when I run into a
query that needs to be passed any information and that query will be used
in another query...then I have to stop, because I don't know how to
write the SQL code.
My mental "rut" that I am stuck in is this: should I be writing SQL code
that does what my "query within a query" does (which I don't think I can,
because that is why I did it in two or more sub queriesin MS Access)
or is there a way to write SQL code that uses other queries that get passed
parameters?
I don't know if this is a "MySQL" confusion or if it is a "writing SQL code"
confusion.
How should I write MySQL code; is it just one big long and ugly statement, or is
there a way to utilize record sets from other paramiterized SQL code?
I hope I am making my self clear, to be honest; this is really fuzzy with
me. I know that MS Access give me a lot of shortcuts, but being able to
use parameter queries within queries is so fundamental to how I work in MS
Access that I am having a difficult time understanding the MySQL steps to
accomplish the same thing.
Any help or suggestions are welcome!
Now, keep in mind that I am coming from the MS Access database world trying to
now work in the MySQL world.
In Access I am accustomed to writing a query "Query A" that takes a
"non-hard coded" parameter, like "[Enter City]" and then using that query
in yet another query "Query B". When I run the second query "Query B" I
will be prompted for "[Enter City]" and then get my record set from
"Query A" that used records from "Query B".
I have been converting my MS Access queries to MySQL's SQL code which I
have actually become good at, believe it or not. But when I run into a
query that needs to be passed any information and that query will be used
in another query...then I have to stop, because I don't know how to
write the SQL code.
My mental "rut" that I am stuck in is this: should I be writing SQL code
that does what my "query within a query" does (which I don't think I can,
because that is why I did it in two or more sub queriesin MS Access)
or is there a way to write SQL code that uses other queries that get passed
parameters?
I don't know if this is a "MySQL" confusion or if it is a "writing SQL code"
confusion.
How should I write MySQL code; is it just one big long and ugly statement, or is
there a way to utilize record sets from other paramiterized SQL code?
I hope I am making my self clear, to be honest; this is really fuzzy with
me. I know that MS Access give me a lot of shortcuts, but being able to
use parameter queries within queries is so fundamental to how I work in MS
Access that I am having a difficult time understanding the MySQL steps to
accomplish the same thing.
Any help or suggestions are welcome!