Linked Questions

0 votes
1 answer
501 views

I have a query that runs fine, when I try to add one more column to where clouses it cannot find the column and gives an error. SELECT '1' AS `row_count`, ( SELECT COUNT(*) FROM ...
Ozan Kurt's user avatar
  • 3,863
0 votes
1 answer
80 views

So i am trying to use Between Timestamp as follows , i have date stored as Unix time stamp and i am 1st trying to convert it, and then get all users between the said time. SELECT users.*, ...
noobie-php's user avatar
  • 7,324
-1 votes
1 answer
77 views

This is what i'm trying to query for example: Code Example: SELECT IF(MAIN.PROCESS = 0,"YES","NO") AS `SUCCESS_LOG`, FROM `XLSX_UPLOAD` AS MAIN WHERE `SUCCESS_LOG` LIKE 'NO' ...
Gordon's user avatar
  • 1,650
-4 votes
1 answer
92 views

I am very new to programming. In my database class, I have to "return only invoices that have a balance due that's greater than 50". When I run this, nothing shows up. What am I doing wrong? USE ap; ...
Oliver Berglas's user avatar
0 votes
1 answer
53 views

I have multiple tables with data on some clients. What I want to achieve is to output the amount that a certain client was billed for, in the first month he was billed. So I run the code similar to ...
Mamut's user avatar
  • 3
0 votes
1 answer
40 views

There is customer table: ---+-------+------------+ id + name + region + ---+-------+------------+ There is also orders table: ---+--------------+------------+----------+----------------+ id +...
vppy's user avatar
  • 367
0 votes
0 answers
16 views

How do I query on a self-defined variable? Example: SELECT *, MID(dateandtime, 12, 2) as 'xxx' FROM xyz WHERE year = '18-19' AND xxx > 18 Is there a way to use xxx in the query like in the last ...
nemja's user avatar
  • 489
2 votes
3 answers
12k views

i have this sql query (below) and it works great but i need to modify it to select only records with $a first character. I've tried a few variations of the LIKE A% with no luck. The crux of my ...
Lawrence Gadette's user avatar
3 votes
3 answers
19k views

I'm trying to create little search engine for only a small database. "CONCAT () AS name" does not work so how can I use something like Concat() as xxx ? Created an example here http://sqlfiddle.com/#!...
caramba's user avatar
  • 22.5k
3 votes
2 answers
6k views

works select payeeid, EXTRACT(WEEKDAY FROM checkdate) as DOW, (bankcleared - checkdate) as DateDiff from Master where (bankcleared is not null) order by payeeid, DOW, DateDiff adding ...
IElite's user avatar
  • 1,848
2 votes
2 answers
10k views

I have an issue with my query, SELECT id, pseudo, nom, prenom, sexe, ville, FLOOR(DATEDIFF (NOW(), date_naissance)/365) AS mAge FROM user WHERE sexe = 'Homme' AND mAge BETWEEN 18 AND 25 OR ...
Camille Greselle's user avatar
0 votes
2 answers
11k views

I have the following tables: USERS: id,username,owner ADMINS id,username,owner TRANSACTIONS: id,sender_id,sender_type Each user can be owned by an admin Each admin can be owned by another ...
NVG's user avatar
  • 3,393
3 votes
1 answer
4k views

Can anyone help me get this query right. I have a Concert model and another Location model. Concert belongs to a location. Location table has a spatial point field. I need to do three things: order ...
dbr's user avatar
  • 1,047
3 votes
3 answers
3k views

Following up with SELECTing the contents of the Table, which is a result of another value, I wanna keep a condition here on the generated field. If I execute this query: SELECT *, ( SELECT `...
Praveen Kumar Purushothaman's user avatar
1 vote
3 answers
2k views

given a table 'my_table' with columns col1,col2. Is it possible to write a query like this SELECT col1 as my_alias,col2 FROM my_table WHERE my_alias = 'value' I have tried it but get an unknown ...
andrew's user avatar
  • 5,186

15 30 50 per page