Anarchosa Posted February 27 Share Posted February 27 SQL'DE kendi kendime çalışıyorum çalışırken bir sorgu yazdım ancak bağlantıyı kuramadım, örnek veriyorum, bir ürünü silmek istiyorum; Stok Tablosundan ürünün adını silmek istiyorum. Stok barkod tablosundan stoğa bağlı barkodunu silmek istiyorum, Stoğa bağlı birimi silmek istiyorum. Stoğa bağlı fiyat ID'sini silmek istiyorum. 1 stok 4 farklı tabloya yazıldığını düşünürsek ürünü kademeli DELETE kodu çalışması gerekiyorki doğru şekilde silinmesi olsun. SELECT * FROM STOK WHERE ID IN (SELECT * FROM STOK_STOK_BIRIM WHERE STOK IN (SELECT * FROM STOK_STOK_BIRIM_FIYAT WHERE STOK_STOK_BIRIM IN (SELECT * FROM STOK_BARKOD WHERE BARKOD=8690123202379)) Sorguyu böyle yazdım acaba sorun tam nerededir.; Hatası alıyorum Msg 116, Level 16, State 1, Line 29 Only one expression can be specified in the select list when the subquery is not introduced with EXISTS. Msg 116, Level 16, State 1, Line 29 Only one expression can be specified in the select list when the subquery is not introduced with EXISTS. Msg 116, Level 16, State 1, Line 29 Only one expression can be specified in the select list when the subquery is not introduced with EXISTS. Quote Link to comment Share on other sites More sharing options...
Mehmet Posted February 28 Share Posted February 28 Bu sorguyu SQL sorgu arayüzüne yapıştırıp bilgi verirmisin. SELECT * FROM STOK WHERE ID IN ( SELECT stok_id FROM STOK_STOK_BIRIM WHERE stok_id IN ( SELECT stok_id FROM STOK_STOK_BIRIM_FIYAT WHERE stok_stok_birim_id IN ( SELECT stok_stok_birim_id FROM STOK_BARKOD WHERE BARKOD = '8690123202379' ) ) ); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.