We’re rewarding the question askers & reputations are being recalculated! Read more.
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 41243

MySQL is an open-source, relational database management system. If your PHP code uses MySQLi, use the MySQLi tag instead.

5
votes
It looks better, but I'm still going to recommend using a variable to replace this snippet. SELECT FLOOR((COUNT(*) / (2 + 1)) + 1) threshold FROM votes You could perhaps write a stored procedure …
answered Jun 16 '14 by RubberDuck
11
votes
Disclaimer: I'm a SQL Server guy. I might get the particular syntax of MySQL wrong. I apologize if I do. The first thing I notice is this that subquery shows up over and over again in your query … vote_candidate HAVING votes_above_the_threshold >= @threshold This a good candidate for a temporary table. I don't know how to create and populate a table in MySQL, so you'll have to look it up …
answered Jun 13 '14 by RubberDuck
6
votes
ProductType should be normalized a bit further with a ProductCategory table. Alternatively, you could add a description column to product type, but I think the category table makes more sense. Inste …
answered Jul 5 '14 by RubberDuck
4
votes
First thing's first. The indentation is all jacked up. There's not really a standard for formatting SQL, but as a rule of thumb, Select, From, and Where for any (sub)query should be at the same indent …
answered Jul 31 '14 by RubberDuck
3
votes
This is a pet peeve of mine, and others have disagreed with me about it, so please take it with a grain of salt. I really just can't stand single letter aliases. I mean, is cpu really so long that you …
answered Sep 19 '14 by RubberDuck
2
votes
Use a pivot query to select the data from the database in the correct format. Then you don't need to use a dictionary, but just a regular old List which you can bind to. dataGridView.DataSource = my …
answered Mar 3 '16 by RubberDuck
2
votes
I'm afraid there's not much we can do to help with this kind of question. There's not much obviously wrong. You likely need to run the query analyzer and add some missing indices and keys. Regardless, …
answered Sep 4 '15 by RubberDuck
2
votes
You don't show it here, but I guarantee you're splitting on whitespace. Which is wrong. Condsider the name Jane MaryAnne Vander Werf. You're going to cut off the second half of this person's last name …
answered Jun 4 '15 by RubberDuck
4
votes
TL;DR I wasn't going to review this, but I couldn't stop reading it again and again. So, here I am reviewing it. I'm going to go down line by line, but first let me address your question. Would creat …
answered Jul 23 '14 by RubberDuck