Can I apply where clause on a alias in mysql?

|
SureshLaraDev 2021-05-13 17:14:16
Share the screenshot
VIKI 2021-05-13 17:14:36
Okkk few seconds Bro
SureshLaraDev 2021-05-13 17:14:42
Ok
VIKI 2021-05-13 17:15:13
I tried last night.. and was able to add one foriegn key by setting the foreign key as unsignedBigInteger
VIKI 2021-05-13 17:16:19
laravel_discuss-80810.jpg

SureshLaraDev 2021-05-13 17:27:52
Now take some rest. Stay happy. πŸ˜‚πŸ˜‚
Rashid 2021-05-13 17:35:20
if you are not using foreign key constrain you need to specify the column name in eloquent relations
Rashid 2021-05-13 17:38:04
VIKI 2021-05-13 17:16:19

is there user table

Yislam 2021-05-13 18:10:35
Who can teach me laravel , I would work for him for free
SureshLaraDev 2021-05-13 18:12:45
Yislam 2021-05-13 18:10:35
Who can teach me laravel , I would work for him for free

YOU

simon_an 2021-05-13 18:15:15
SureshLaraDev 2021-05-13 18:12:45
YOU

Hahaha

simon_an 2021-05-13 18:16:43
Yislam 2021-05-13 18:10:35
Who can teach me laravel , I would work for him for free

I will help you learn.

Yislam 2021-05-13 18:17:00
simon_an 2021-05-13 18:16:43
I will help you learn.

Contact me private

oim_123 2021-05-13 18:17:40
Yislam 2021-05-13 18:10:35
Who can teach me laravel , I would work for him for free

Take help from youtube.

sobirjonovs 2021-05-13 18:21:21
+++
sobirjonovs 2021-05-13 18:22:24
They are called as ungrateful!
simon_an 2021-05-13 18:22:43
Yeah
Yislam 2021-05-13 18:22:48
sobirjonovs 2021-05-13 18:22:24
They are called as ungrateful!

Who?

sobirjonovs 2021-05-13 18:23:01
Yislam 2021-05-13 18:22:48
Who?

Gap finds its owner

Yislam 2021-05-13 18:23:21
sobirjonovs 2021-05-13 18:23:01
Gap finds its owner

Who are the gaps?

fiminb 2021-05-13 18:23:24
My view cache was not clear at all
I use all artisan commands
SureshLaraDev 2021-05-13 18:23:48
sobirjonovs 2021-05-13 18:22:24
They are called as ungrateful!

Don’t mind him

simon_an 2021-05-13 18:23:55
Anyway, nobody teaches you programming, event those who have computer science degree will tell you that they were not taught by their lecturers
sobirjonovs 2021-05-13 18:24:06
Yislam 2021-05-13 18:23:21
Who are the gaps?

I meant a WORD,

SureshLaraDev 2021-05-13 18:24:16
Yislam…show some respect man
ktmsulaim 2021-05-13 18:24:19
Hi,
Can I apply where clause on a alias in mysql?

DB::table(‘orders’)->select(“users.name”, “users.id”, DB::raw(“SUM(orders.amount) as total_amount”))
->join(“users”, ‘orders.user_id’, ‘=’, ‘users.id’)
->orderBy(“total_amount”, “desc”)
->groupBy(‘users.id’)
->take(5)
->get();

Now I want to apply where condition on total_amount. Any help would appreciated!!!

simon_an 2021-05-13 18:24:30
SureshLaraDev 2021-05-13 18:24:16
Yislam…show some respect man

Hahaha

sobirjonovs 2021-05-13 18:24:52
ktmsulaim 2021-05-13 18:24:19
Hi,
Can I apply where clause on a alias in mysql?

DB::table(‘orders’)->select(“users.name”, “users.id”, DB::raw(“SUM(orders.amount) as total_amount”))
->join(“users”, ‘orders.user_id’, ‘=’, ‘users.id’)
->orderBy(“total_amount”, “desc”)
->groupBy(‘users.id’)
->take(5)
->get();

Now I want to apply where condition on total_amount. Any help would appreciated!!!

php artisan optimize
php artisan config:cache

they are enough

SureshLaraDev 2021-05-13 18:24:54
Looks like we have beg him for respect and teach him for free
SureshLaraDev 2021-05-13 18:25:31
how old are you Yislam?
ktmsulaim 2021-05-13 18:25:46
sobirjonovs 2021-05-13 18:24:52
php artisan optimize
php artisan config:cache

they are enough

Sry…how it will be working?

sobirjonovs 2021-05-13 18:26:11
ktmsulaim 2021-05-13 18:25:46
Sry…how it will be working?

try and show the result before asking

SureshLaraDev 2021-05-13 18:27:13
Sorry not interested 🀣🀣🀣
sobirjonovs 2021-05-13 18:27:49
Anyway, whoever says I’m ready for help, you should contact him first
Yislam 2021-05-13 18:28:09
SureshLaraDev 2021-05-13 18:27:13
Sorry not interested 🀣🀣🀣

That’s your problemπŸ˜‚

|