Vote count: 0 My knowledge of MySQL is basic. I want to build a query to retu all rows when is reached that sum a given amount value given value: 1.20 field to sum: amount order by expirydate table: id name expirydate amount 1 name1 11-08-16 0.20 2 name2 10-08-16 1.50 3 name3 08-08-16 1.00 I need the result from id 3,2 order by expiry date asked 23 secs agoJosef Let's block ads!...
ادامه مطلبVote count: 0 I'm trying to combine these 2 SQL queries. SELECT * FROM `history` WHERE `ID` = 56 SELECT * FROM `live` WHERE `ID` = 56 AND `ACTIVE` = 0 AND t1.`Shown` = 'complete' I've tried doing something like this: SELECT t1.*,t2.* FROM `history` t1 JOIN `live` t2 ON t1.`ID` = 56 AND t1.`ACTIVE` = 0 AND t1.`Shown` = 'complete' WHERE t2.`ID` = 56 But the query above results in selecting everything from live and forgetting about history. asked 28 secs agoFilip Let's block ads!...
ادامه مطلبVote count: 0 Is it possible to us a named count function (I.E SELECT n.name, count(c.name) as freq FROM names as n, names as c WHERE freq < 1 AND gender = 'f' order by rand() ) in the where column of a query, or would i have to do this another way? asked 58 secs agoPatrick Pierson Let's block ads!...
ادامه مطلبVote count: 0 At the moment I would like to run a store procedure that retus the count of the number of records. The records look like this The stored procedure looks like ALTER PROCEDURE [dbo].[USP_NEWFOLDER_COUNT] -- Add the parameters for the stored procedure here AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here -- FileLocation is a table SELECT @@ROWCOUNT FROM FileLocation END The...
ادامه مطلبVote count: 0 I have a table Types that has the following columns: ID, Name, Type. The table is filled with about 300 rows. One of the rows: ID Name Type ------------------ 1 BMW S 1000 RR The following query retus this row: SELECT * FROM Types WHERE Name = 'BMW' However, the following query retus nothing: SELECT * FROM Types WHERE Type = 'S 1000 RR' There are no extra spaces in the Type, and the data types of Name and Type are exactly the same (varchar 255, utf8_unicode_ci). What can possibly c...
ادامه مطلب