Linked Questions

4 votes
2 answers
138 views

I have a complex query that does multiple matches across multiple columns and then orders by relevance. Everything works fine UNTIL I add WHERE 'rank' > 0 This then returns an empty results set. ...
GrahamTheDev's user avatar
  • 25.3k
0 votes
1 answer
167 views

SELECT mob_no, (SELECT max(str_to_date(debit_date,'%d/%m/%Y')) FROM client_debit_bal WHERE mob_no='".$mobno."') AS date, sum(debit_amt) AS debit FROM client_debit_bal WHERE date_format(...
Dinesh G's user avatar
  • 242
1 vote
4 answers
65 views

SELECT zlec_status.nazwa AS Status, piorytet.nazwa AS Priorytet, Concat(koord.imie, ' ', koord.nazwisko) AS `Koordynator`, Concat(...
Kavvson Empcraft's user avatar
0 votes
1 answer
151 views

SELECT VoteTypeId AS vcol FROM VoteType v WHERE v.VoteTypeId = 4 and table structure is vcol VoteType ----------- -------------------------------------------------- 1 Yes/No 2 ...
Leo Chan's user avatar
  • 4,487
0 votes
3 answers
142 views

I am receiving an error during my age calculation. Here is my query: SELECT (YEAR(CURDATE()) - YEAR(STR_TO_DATE(birthdate, '%m/%d/%Y'))) age, name FROM pers WHERE age >= 50 ORDER BY age DESC ...
Kirk Logan's user avatar
2 votes
0 answers
172 views

I've upgraded from MySQL 5.5 to 5.7 and I have a query that no longer works. It's quite a big one but I've reduced it down to this - the query itself doesn't really make sense but demonstrates: ...
Matthew's user avatar
  • 131
-1 votes
3 answers
158 views

To have students (student_id, course_id, course_name) who take exactly only one course, using a simple SQL statement with no sub-query and no join at all student_id course_id course_name ----------...
jeff's user avatar
  • 157
0 votes
2 answers
110 views

How to filter data in the below query using where clause for Balance column. I'm getting the error [Unknown column "Balance" in "where clause"] when i use Balance in where condition. select *,(it....
Uma's user avatar
  • 239
0 votes
1 answer
99 views

Newbie to sql here. I am trying to select only tuples whose values in one column are larger than the average of that column. The problem is, the relation I am working with is created in the FROM ...
Spencer's user avatar
  • 880
0 votes
2 answers
54 views

If I run below query in my phpmyadmin it throw me below error > Error in query (1054): Unknown column 'QTY' in 'where clause' SELECT User_Name, COUNT(User_Name) AS QTY FROM preusage WHERE ...
Mizanur Rahman's user avatar
0 votes
2 answers
66 views

I am trying to do an SQL query to get all the messages sent between 2 users: the "Sender" and the "Reciever" (yes I know this is spelled wrong) are foreign keys to the Users table. I want to get back ...
user3434701's user avatar
0 votes
3 answers
91 views

Why this query is not returning data of 2011 and 2012. Can anyone help me out.Thanks in advance. SELECT country_code, SUM(`attendance`) as k6_attendance, count(*) as total_events , ...
Anuj Jain's user avatar
0 votes
0 answers
93 views

i've in a MariaDB's schema these tables: CLIENTI id | ragionesociale | idZucchetti | MORE COLS.... 1 | SEA srl | 569 | .... 2 | Contoso ...
majinb_igor's user avatar
1 vote
0 answers
79 views

Is it possible to use an alias in a WHERE condition? For example: SELECT n.name, count(c.name) as freq FROM names as n, names as c WHERE freq < 1 AND gender = 'f' order by rand() ) Or would I ...
Patrick Pierson's user avatar

15 30 50 per page
1 2
3