I'm trying to retrieve a "random" row from a table where the randomness is "weighted" by a factor, let's call it "weight" (original, huh?).
the following (pseude-SQL) works but is EXTREMELY slow:
SELECT * FROM table
ORDER BY RAND() * ( 1 / weight)
LIMIT 1;
I've read that "ORDER BY RAND()"...
Sorry for all the questions guys! I'm a SQL newb...
I have 2 tables I'm trying to join:
traits
trait_num trait_name trait_value
1 color blue
2 color red
3 color green
4 size small
5 size medium
6 size...
This query I'm trying to construct seems simple, but I can't get it to work. Can someone please help?!?!?!
I have two tables...
My "products_to_traits" table has the following data:
product_num trait_num
1 1
1 12
1 23
1 30
2 1
2 30
2...
i'm trying to construct what i believe would be a fairly simple query against 1 table with just 3 columns. however, with my limited sql knowledge, it feels like i'm going in circles. can any mysql gurus please help?
my table is called "categories" and has the following fields and example data...
Does anyone know how to open multiple instances of the same report?
I have a report named: rptPOs
I need open multiple instances of the report at one time (so the user will know to print ALL instances of the report).
I'm trying to open each report each report passing different filter criteria...
if i've got table data that looks like this:
Index Option Name Option Value
763 Color Black
763 Size XL
764 Color Green
764 Size XL
765 Color White
765 Size XL
If I'm given an items' unique set of options, [Option Name]="Color" [Option Value]="Black", and...
Can any of you SQL gods help me?
I have two tables (tblProducts, tblProductOptions)
tblProducts has these fields:
Index
Product Code
Base Price
tblProductOptions has these fields:
Index
Option Name
Option Value
Upcharge
I have a relationship set up between the 2 tables such that any one...
This might be a silly question, but here goes...
When I view data within my tables, due to the relationships I've created, there's a little "+" sign next to each record. Clicking on the "+" enables me to expand and collapse each record to see all the related data.
Does...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.