|
I want Microsoft SQL server queries corresponding to the following Oracle queries
//get schema of a table desc tablename; //get the names of all tables select * from tab;
Answer Snippets (Read the full thread at stackoverflow):
INFORMATION_SCHEMA.Tables -> gives you access to table names
INFORMATION_SCHEMA.Columns -> gives you access to column names
Here is another link with a complete list of catalog... .
Check this link out.
You have access to that info through metadata tables.
|
|
Are JOIN queries faster than several queries? (You run your main query, and then you run many other SELECTs based on the results from your main query)
I'm asking because JOINing them would complicate A LOT the design of my application
If they are faster...
Started by Andreas Bonini on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Construct both separate queries and joins, then time each of them.
To do 1 trip than several.
|
|
Hello I made a SQL test and dubious/curious about one question:
In which sequence are queries and sub-queries executed by the SQL engine?
the answers was
primary query -> sub query -> sub sub query and so on sub sub query -> sub query -> prime...
Started by Igor on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
But it's not quite "on the fly"....
This may vary for outwardly identical queries and tables depending on statistics, data distribution.
The part deciding about that is called a query optimizer it.
In which (sub)queries are executed.
|
Ask your Facebook Friends
|
Hello, I have 2 tables namely Person_Organization and Person_Organization_other and nested query is :-
SELECT Person_Organization_id FROM Person_Organization_other WHERE company_name IN ( SELECT company_name from Person_Organization_other WHERE Person...
Answer Snippets (Read the full thread at stackoverflow):
In fact the SQL server optimises all queries that it executes by reducing them to an execution....
Id
The view that nested queries are less performant and should be flattened out using joins cases using a subquery is just as good as using a join.
|
|
Is there a way this hand coded query could become dynamic?
SELECT master.id, (select count(0) as score1 from scores where scores.id = master.id AND scores.category = '1'), (select count(0) as score2 from scores where scores.id = master.id AND scores.category...
Started by Chris Denman on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
First, an easier way to do it, with less typing and less overhead would be:
SELECT master.id , SUM(IF(s.category='1',1,0)) cat1 , SUM(IF(s.category='2',1,0)) cat2 , SUM(1) total FROM master m LEFT JOIN scores... .
Yes, basically you want to code a pivot table.
|
|
I can log all the mysql queries by enabling the general log. But it does not show the failed queries.
Is there a way to save failed queries as well?
Started by shantanuo on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
There is....
You can log ALL queries by setting the sql_log_off variable to 0 (you should have super privilegies)
or you can log failed queries by PHP :
function sql_query($data) { $sql = mysql_query($data failed queries.
|
|
Hi,
I have setup the following jQuery UI Dialog within my document.ready() section, i.e:
$("#dialog").dialog({ autoOpen: false, bgiframe: true, resizable: false, modal: true, buttons: { 'Ok': function() { $(this).dialog("close"); } } });
1) My question...
Started by tonsils on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
If you want the dialog appear only when that condition is met, you should set the autoOpen option to false , later in your code, after you increment your counter variable, you should check its value and show it if the counter has the particular value... .
|
|
What is actually better? Having classes with complex queries responsible to load for instance nested objects? Or classes with simple queries responsible to load simple objects?
With complex queries you have to go less to database but the class will have...
Started by Lieven Cardoen on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
This is a key determinant in what you should do because if you can only execute up systems with awful performance due in large part to doing separate queries (particularly correlated queries) instead of joins....
queries in parallel.
|
|
What would be the best way to trouble shoot thousands of sql queries everyday? Trouble shooting might includes
finding the blocked queries, improving performance of query, Queries that are hogging maximum processing time.
Started by Explorer on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
That way.
If queries are being generated ad hoc, then maybe providing some useful, debugged queries for users to select from.
Then maybe drilling down into the most proliferate queries causing the problem.
|
|
Hi,
I run a site at localhost and i would like to see which queries are executed. I've seen that some pages execute a lot of queries (eg 107) and i would like to see which are all these,as i think they're a lot.. (i know how many queries are executed,...
Started by Manolis on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Modify the function that you use to execute queries, so that it will log them into a file or just.
|