is that possible to select twice a column from a table and modify only one of them? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

is that possible to select twice a column from a table and modify only one of them?

eg: select count(company), count(company) from customer but I want to filter only one of the column with let's say where invoice is not null I have tried to specify their name but it's seems to be invalid to differentiate column from a same table by only changing their name and apply name.invoice command neither the join, union works

15th Dec 2016, 12:20 AM
Rane Foong
Rane Foong - avatar
2 Answers
+ 1
Dude, you must specify it after the WHERE clause and if you wish multiple cases either run two separate queries using union or use the operator OR in the WHERE conditions, which does not make too much sense. Ex: SELECT company From table Where (company is not null);
3rd Jan 2017, 8:21 AM
Olavo André Parno
Olavo André Parno - avatar
0
thank your for answering, I know this can be done by joining multiple queries but does that means there is no possible approach to differentiate the same column that has been called twice in just one query?
4th Jan 2017, 12:20 AM
Rane Foong
Rane Foong - avatar